Fixing nxos_vrf_interface (#5034)

reviewable/pr18780/r1
Gabriele 9 years ago committed by Peter Sprygada
parent 690bbcb148
commit 39cd41f636

@ -251,6 +251,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 get_cli_body_ssh_vrf_interface(command, response, module):
@ -290,7 +299,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()
@ -466,6 +475,8 @@ def main():
changed = True
changed_vrf = get_interface_info(interface, module)
end_state = dict(interface=interface, vrf=changed_vrf)
if 'configure' in commands:
commands.pop(0)
results = {}
results['proposed'] = proposed
@ -481,4 +492,4 @@ def main():
if __name__ == '__main__':
main()
main()
Loading…
Cancel
Save