diff options
author | Gabriele <gabrielegerbino@gmail.com> | 2016-09-30 16:22:24 -0400 |
---|---|---|
committer | Peter Sprygada <privateip@users.noreply.github.com> | 2016-09-30 16:22:24 -0400 |
commit | c977859ae55a3233883f971325ca5090eaf0dad3 (patch) | |
tree | bd33c4b61c457ab3c2755a059b87acae4b03843c /network/nxos | |
parent | 5cc4a7766a6a9314ec7847d434573d49cf8563c0 (diff) | |
download | ansible-modules-core-c977859ae55a3233883f971325ca5090eaf0dad3.tar.gz |
Fxing nxos_ip_interface (#5013)
Diffstat (limited to 'network/nxos')
-rw-r--r-- | network/nxos/nxos_ip_interface.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/network/nxos/nxos_ip_interface.py b/network/nxos/nxos_ip_interface.py index fa9abfd7..eef79543 100644 --- a/network/nxos/nxos_ip_interface.py +++ b/network/nxos/nxos_ip_interface.py @@ -258,6 +258,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(command, response, module): @@ -303,7 +312,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() @@ -680,6 +689,8 @@ def main(): changed = True end_state, address_list = get_ip_interface(interface, version, module) + if 'configure' in cmds: + cmds.pop(0) results = {} results['proposed'] = proposed |