Fix nxos_snmp_community command ordering (#66094)
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
This commit is contained in:
parent
bac2e02900
commit
4674435367
1 changed files with 6 additions and 2 deletions
|
@ -153,9 +153,12 @@ def config_snmp_community(delta, community):
|
||||||
'no_acl': 'no snmp-server community {0} use-acl {no_acl}'
|
'no_acl': 'no snmp-server community {0} use-acl {no_acl}'
|
||||||
}
|
}
|
||||||
commands = []
|
commands = []
|
||||||
for k, v in delta.items():
|
for k in delta.keys():
|
||||||
cmd = CMDS.get(k).format(community, **delta)
|
cmd = CMDS.get(k).format(community, **delta)
|
||||||
if cmd:
|
if cmd:
|
||||||
|
if 'group' in cmd:
|
||||||
|
commands.insert(0, cmd)
|
||||||
|
else:
|
||||||
commands.append(cmd)
|
commands.append(cmd)
|
||||||
cmd = None
|
cmd = None
|
||||||
return commands
|
return commands
|
||||||
|
@ -219,6 +222,7 @@ def main():
|
||||||
commands.append(command)
|
commands.append(command)
|
||||||
|
|
||||||
cmds = flatten_list(commands)
|
cmds = flatten_list(commands)
|
||||||
|
|
||||||
if cmds:
|
if cmds:
|
||||||
results['changed'] = True
|
results['changed'] = True
|
||||||
if not module.check_mode:
|
if not module.check_mode:
|
||||||
|
|
Loading…
Reference in a new issue