Fix nxos_snmp_community command ordering (#66094)

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
This commit is contained in:
Nilashish Chakraborty 2020-01-07 12:15:43 +05:30 committed by GitHub
parent bac2e02900
commit 4674435367
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
@ -219,6 +222,7 @@ def main():
commands.append(command)
cmds = flatten_list(commands)
if cmds:
results['changed'] = True
if not module.check_mode: