Fixing nxos_vpc_interface (#5032)

reviewable/pr18780/r1
Gabriele 8 years ago committed by Peter Sprygada
parent 770fd68b42
commit 3b4bbb2497

@ -257,6 +257,15 @@ def execute_config_command(commands, module):
clie = get_exception() clie = get_exception()
module.fail_json(msg='Error sending CLI commands', module.fail_json(msg='Error sending CLI commands',
error=str(clie), commands=commands) error=str(clie), commands=commands)
except AttributeError:
try:
commands.insert(0, 'configure')
module.cli.add_commands(commands, output='config')
response = module.cli.run_commands()
except ShellError:
clie = get_exception()
module.fail_json(msg='Error sending CLI commands',
error=str(clie), commands=commands)
return response return response
@ -300,7 +309,7 @@ def execute_show(cmds, module, command_type=None):
module.cli.add_commands(cmds, output=command_type) module.cli.add_commands(cmds, output=command_type)
response = module.cli.run_commands() response = module.cli.run_commands()
else: else:
module.cli.add_commands(cmds, output=command_type) module.cli.add_commands(cmds, raw=True)
response = module.cli.run_commands() response = module.cli.run_commands()
except ShellError: except ShellError:
clie = get_exception() clie = get_exception()
@ -563,6 +572,8 @@ def main():
if 'error' in output.lower(): if 'error' in output.lower():
module.fail_json(msg=output.replace('\n', '')) module.fail_json(msg=output.replace('\n', ''))
end_state = get_portchannel_vpc_config(module, portchannel) end_state = get_portchannel_vpc_config(module, portchannel)
if 'configure' in cmds:
cmds.pop(0)
results = {} results = {}
results['proposed'] = proposed results['proposed'] = proposed

Loading…
Cancel
Save