diff --git a/network/nxos/nxos_vpc.py b/network/nxos/nxos_vpc.py index 62635e84610..3fae9cee00d 100644 --- a/network/nxos/nxos_vpc.py +++ b/network/nxos/nxos_vpc.py @@ -305,6 +305,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): @@ -349,7 +358,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() @@ -629,6 +638,8 @@ def main(): changed = True execute_config_command(cmds, module) end_state = get_vpc(module) + if 'configure' in cmds: + cmds.pop(0) results = {} results['proposed'] = proposed