summaryrefslogtreecommitdiff
path: root/network/nxos
diff options
context:
space:
mode:
authorGabriele <gabrielegerbino@gmail.com>2016-09-30 16:23:34 -0400
committerPeter Sprygada <privateip@users.noreply.github.com>2016-09-30 16:23:34 -0400
commit8da99d4e703a027a2a4be0abef491ced3c57fe13 (patch)
treef194d278787359a5341e6e50d7490618f21ba4e9 /network/nxos
parentc88404c11977df048b3468b6993e8d8c1cebff3e (diff)
downloadansible-modules-core-8da99d4e703a027a2a4be0abef491ced3c57fe13.tar.gz
Fixing nxos_acl (#5006)
* Fixing nxos_acl * Fixing nxos_acl
Diffstat (limited to 'network/nxos')
-rw-r--r--network/nxos/nxos_acl.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/network/nxos/nxos_acl.py b/network/nxos/nxos_acl.py
index d2e13a3d..b0e3223e 100644
--- a/network/nxos/nxos_acl.py
+++ b/network/nxos/nxos_acl.py
@@ -439,7 +439,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()
@@ -624,6 +624,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():
@@ -787,6 +796,8 @@ def main():
execute_config_command(cmds, module)
changed = True
new_existing_core, end_state, seqs = get_acl(module, name, seq)
+ if 'configure' in cmds:
+ cmds.pop(0)
results['proposed'] = proposed
results['existing'] = existing_core