diff --git a/lib/ansible/modules/system/ufw.py b/lib/ansible/modules/system/ufw.py index 762a1c6c513..573ee07e64a 100644 --- a/lib/ansible/modules/system/ufw.py +++ b/lib/ansible/modules/system/ufw.py @@ -321,12 +321,12 @@ def main(): to_ip=dict(type='str', default='any', aliases=['dest', 'to']), to_port=dict(type='str', aliases=['port']), proto=dict(type='str', aliases=['protocol'], choices=['ah', 'any', 'esp', 'ipv6', 'tcp', 'udp', 'gre', 'igmp']), - app=dict(type='str', aliases=['name']), + name=dict(type='str', aliases=['app']), comment=dict(type='str'), ), supports_check_mode=True, mutually_exclusive=[ - ['app', 'proto', 'logging'], + ['name', 'proto', 'logging'], ], required_one_of=([command_keys]), required_by=dict( @@ -496,7 +496,7 @@ def main(): if relative_to_cmd == 'zero': insert_to = params['insert'] else: - (_, numbered_state, _) = module.run_command([ufw_bin, 'status', 'numbered']) + (dummy, numbered_state, dummy) = module.run_command([ufw_bin, 'status', 'numbered']) numbered_line_re = re.compile(R'^\[ *([0-9]+)\] ') lines = [(numbered_line_re.match(line), '(v6)' in line) for line in numbered_state.splitlines()] lines = [(int(matcher.group(1)), ipv6) for (matcher, ipv6) in lines if matcher] @@ -524,11 +524,11 @@ def main(): for (key, template) in [('from_ip', "from %s"), ('from_port', "port %s"), ('to_ip', "to %s"), ('to_port', "port %s"), - ('proto', "proto %s"), ('app', "app '%s'")]: + ('proto', "proto %s"), ('name', "app '%s'")]: value = params[key] cmd.append([value, template % (value)]) - ufw_major, ufw_minor, _ = ufw_version() + ufw_major, ufw_minor, dummy = ufw_version() # comment is supported only in ufw version after 0.35 if (ufw_major == 0 and ufw_minor >= 35) or ufw_major > 0: cmd.append([params['comment'], "comment '%s'" % params['comment']]) diff --git a/test/sanity/pylint/ignore.txt b/test/sanity/pylint/ignore.txt index 1b170cb6790..ab52a7e1403 100644 --- a/test/sanity/pylint/ignore.txt +++ b/test/sanity/pylint/ignore.txt @@ -64,7 +64,6 @@ lib/ansible/modules/system/lvg.py blacklisted-name lib/ansible/modules/system/lvol.py blacklisted-name lib/ansible/modules/system/parted.py blacklisted-name lib/ansible/modules/system/timezone.py blacklisted-name -lib/ansible/modules/system/ufw.py blacklisted-name lib/ansible/modules/utilities/logic/wait_for.py blacklisted-name lib/ansible/modules/web_infrastructure/rundeck_acl_policy.py blacklisted-name lib/ansible/parsing/vault/__init__.py blacklisted-name diff --git a/test/sanity/validate-modules/ignore.txt b/test/sanity/validate-modules/ignore.txt index 8ccf9177ee2..9b2e4266e6f 100644 --- a/test/sanity/validate-modules/ignore.txt +++ b/test/sanity/validate-modules/ignore.txt @@ -3708,7 +3708,6 @@ lib/ansible/modules/system/syspatch.py E337 lib/ansible/modules/system/systemd.py E336 lib/ansible/modules/system/systemd.py E337 lib/ansible/modules/system/sysvinit.py E337 -lib/ansible/modules/system/ufw.py E337 lib/ansible/modules/system/user.py E210 lib/ansible/modules/system/user.py E324 lib/ansible/modules/system/user.py E327