Fixing nxos_igmp_interface (#5010)

reviewable/pr18780/r1
Gabriele 8 years ago committed by Peter Sprygada
parent ef85fcb068
commit d47e38a8f9

@ -430,7 +430,7 @@ def execute_show(cmds, module, command_type=None):
module.cli.add_commands(cmds, output=command_type)
response = module.cli.run_commands()
else:
module.cli.add_commands(cmds, output=command_type)
module.cli.add_commands(cmds, raw=True)
response = module.cli.run_commands()
except ShellError:
clie = get_exception()
@ -715,6 +715,15 @@ def execute_config_command(commands, module):
clie = get_exception()
module.fail_json(msg='Error sending CLI commands',
error=str(clie), commands=commands)
except AttributeError:
try:
commands.insert(0, 'configure')
module.cli.add_commands(commands, output='config')
module.cli.run_commands()
except ShellError:
clie = get_exception()
module.fail_json(msg='Error sending CLI commands',
error=str(clie), commands=commands)
def main():
@ -881,6 +890,8 @@ def main():
execute_config_command(cmds, module)
changed = True
end_state = get_igmp_interface(module, interface)
if 'configure' in cmds:
cmds.pop(0)
results['proposed'] = proposed
results['existing'] = existing_copy
@ -892,4 +903,4 @@ def main():
if __name__ == '__main__':
main()
main()
Loading…
Cancel
Save