Skip to content

Commit

Permalink
Fix exception when using masquerade
Browse files Browse the repository at this point in the history
The following snippet:

  - name: Let the DMZ connect to internet
  firewalld:
    zone: dmz
    masquerade: True
    permanent: True
    immediate: True
    state: enabled

will fail with this error message:

  Exception caught: set_masquerade_enabled() takes 1 positional argument but 3 were given

It turn out that it treat 'zone' as a array of string instead of 1 string.
I only tested on Python 3 with a Fedora 25.
  • Loading branch information
mscherer authored and bcoca committed Jul 3, 2017
1 parent 88099e2 commit bda066f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ansible/modules/system/firewalld.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ def main():
action_handler(set_masquerade_permanent, (zone, True))
changed=True
if not is_enabled_immediate:
action_handler(set_masquerade_enabled, (zone))
action_handler(set_masquerade_enabled, (zone,))
changed=True
if changed:
msgs.append("Added masquerade to zone %s" % (zone))
Expand All @@ -1022,7 +1022,7 @@ def main():
action_handler(set_masquerade_permanent, (zone, False))
changed=True
if is_enabled_immediate:
action_handler(set_masquerade_disabled, (zone))
action_handler(set_masquerade_disabled, (zone,))
changed=True
if changed:
msgs.append("Removed masquerade from zone %s" % (zone))
Expand Down

0 comments on commit bda066f

Please sign in to comment.