From 272b20000f7f974b13ad10475f8e2bcc0f66f2a6 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Fri, 30 Sep 2016 16:23:17 -0400 Subject: [PATCH] Fixing nxos_acl_interface (#5007) --- .../modules/network/nxos/nxos_acl_interface.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ansible/modules/network/nxos/nxos_acl_interface.py b/lib/ansible/modules/network/nxos/nxos_acl_interface.py index edfd369437..d00b263d8c 100644 --- a/lib/ansible/modules/network/nxos/nxos_acl_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_acl_interface.py @@ -683,6 +683,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(): @@ -742,6 +751,8 @@ def main(): interfaces_acls, this_dir_acl_intf = other_existing_acl( end_state_acls, interface, direction) end_state = this_dir_acl_intf + if 'configure' in cmds: + cmds.pop(0) else: cmds = []