Browse Source

Merge pull request #2838 from mscherer/port_py3

Make os_firewall_manage_iptables run on python3
Jason DeTiberus 8 years ago
parent
commit
11594f8470
1 changed files with 2 additions and 1 deletions
  1. 2 1
      roles/os_firewall/library/os_firewall_manage_iptables.py

+ 2 - 1
roles/os_firewall/library/os_firewall_manage_iptables.py

@@ -139,7 +139,7 @@ class IpTablesManager(object): # pylint: disable=too-many-instance-attributes
                 output = check_output(cmd, stderr=subprocess.STDOUT)
 
                 # break the input rules into rows and columns
-                input_rules = [s.split() for s in output.split('\n')]
+                input_rules = [s.split() for s in to_native(output).split('\n')]
 
                 # Find the last numbered rule
                 last_rule_num = None
@@ -269,5 +269,6 @@ def main():
 # pylint: disable=redefined-builtin, unused-wildcard-import, wildcard-import
 # import module snippets
 from ansible.module_utils.basic import *
+from ansible.module_utils._text import to_native
 if __name__ == '__main__':
     main()