Fix nxos_snmp_community command ordering (#66094)

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
(cherry picked from commit 4674435367)

Add changelog for nxos_snmp_community fix

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
pull/66383/head
Nilashish Chakraborty 5 years ago committed by Matt Clay
parent 4a034fdf4e
commit 0d3c5c4bac

@ -0,0 +1,3 @@
---
bugfixes:
- Fix ordering of the commands sent in nxos_snmp_community (https://github.com/ansible/ansible/pull/66094).

@ -153,10 +153,13 @@ def config_snmp_community(delta, community):
'no_acl': 'no snmp-server community {0} use-acl {no_acl}'
}
commands = []
for k, v in delta.items():
for k in delta.keys():
cmd = CMDS.get(k).format(community, **delta)
if cmd:
commands.append(cmd)
if 'group' in cmd:
commands.insert(0, cmd)
else:
commands.append(cmd)
cmd = None
return commands
@ -220,6 +223,7 @@ def main():
commands.append(command)
cmds = flatten_list(commands)
if cmds:
results['changed'] = True
if not module.check_mode:

Loading…
Cancel
Save