From 78c4f03e5086c34688dfb93af52f3bca3b509480 Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Fri, 24 Feb 2017 12:32:28 -0500 Subject: [PATCH] Fix firewalld get_masquerade_enabled_permanent error (#21693) get_masquerade_* functions only take one arg. The action_handler wrapper function expected a tuple, but was being passed (zone) instead of (zone,) making for an ambiquous tuple. The (zone) arg was being treated as a tuple/list of six chars (the zone name) instead of a tuple of one string. This would cause errors like: get_masquerade_enabled_permanent() takes exactly 1 argument (6 given) Fixes #21632 --- lib/ansible/modules/system/firewalld.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/system/firewalld.py b/lib/ansible/modules/system/firewalld.py index 95063a10a1..b4651ba0b4 100644 --- a/lib/ansible/modules/system/firewalld.py +++ b/lib/ansible/modules/system/firewalld.py @@ -991,9 +991,9 @@ def main(): if immediate and permanent: is_enabled_permanent = action_handler( get_masquerade_enabled_permanent, - (zone) + (zone,) ) - is_enabled_immediate = action_handler(get_masquerade_enabled, (zone)) + is_enabled_immediate = action_handler(get_masquerade_enabled, (zone,)) msgs.append('Permanent and Non-Permanent(immediate) operation') if desired_state == "enabled": @@ -1023,7 +1023,7 @@ def main(): msgs.append("Removed masquerade from zone %s" % (zone)) elif permanent and not immediate: - is_enabled = action_handler(get_masquerade_enabled_permanent, (zone)) + is_enabled = action_handler(get_masquerade_enabled_permanent, (zone,)) msgs.append('Permanent operation') if desired_state == "enabled": @@ -1043,7 +1043,7 @@ def main(): changed=True msgs.append("Removed masquerade from zone %s" % (zone)) elif immediate and not permanent: - is_enabled = action_handler(get_masquerade_enabled, (zone)) + is_enabled = action_handler(get_masquerade_enabled, (zone,)) msgs.append('Non-permanent operation') if desired_state == "enabled":