summaryrefslogtreecommitdiff
path: root/network/nxos
diff options
context:
space:
mode:
authorGabriele <gabrielegerbino@gmail.com>2016-09-30 16:18:10 -0400
committerPeter Sprygada <privateip@users.noreply.github.com>2016-09-30 16:18:10 -0400
commit3b4bbb2497fb8a60f3d9bf2a013660330becda4e (patch)
tree6fdbda32026bc12fb7165a100dfa1bb71e3d9bae /network/nxos
parent770fd68b42f6a8590b386aca22c7a5c53ae6fdc1 (diff)
downloadansible-modules-core-3b4bbb2497fb8a60f3d9bf2a013660330becda4e.tar.gz
Fixing nxos_vpc_interface (#5032)
Diffstat (limited to 'network/nxos')
-rw-r--r--network/nxos/nxos_vpc_interface.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/network/nxos/nxos_vpc_interface.py b/network/nxos/nxos_vpc_interface.py
index 4480c587..a621c1b1 100644
--- a/network/nxos/nxos_vpc_interface.py
+++ b/network/nxos/nxos_vpc_interface.py
@@ -257,6 +257,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')
+ 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
@@ -300,7 +309,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()
@@ -563,6 +572,8 @@ def main():
if 'error' in output.lower():
module.fail_json(msg=output.replace('\n', ''))
end_state = get_portchannel_vpc_config(module, portchannel)
+ if 'configure' in cmds:
+ cmds.pop(0)
results = {}
results['proposed'] = proposed