1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
This commit is contained in:
Adrian Likins 2017-02-24 12:32:28 -05:00 committed by GitHub
parent e6a78b38d3
commit 78c4f03e50

View file

@ -991,9 +991,9 @@ def main():
if immediate and permanent: if immediate and permanent:
is_enabled_permanent = action_handler( is_enabled_permanent = action_handler(
get_masquerade_enabled_permanent, 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') msgs.append('Permanent and Non-Permanent(immediate) operation')
if desired_state == "enabled": if desired_state == "enabled":
@ -1023,7 +1023,7 @@ def main():
msgs.append("Removed masquerade from zone %s" % (zone)) msgs.append("Removed masquerade from zone %s" % (zone))
elif permanent and not immediate: 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') msgs.append('Permanent operation')
if desired_state == "enabled": if desired_state == "enabled":
@ -1043,7 +1043,7 @@ def main():
changed=True changed=True
msgs.append("Removed masquerade from zone %s" % (zone)) msgs.append("Removed masquerade from zone %s" % (zone))
elif immediate and not permanent: 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') msgs.append('Non-permanent operation')
if desired_state == "enabled": if desired_state == "enabled":