From 62bf8d0c787434d30af3ac2ec3f6be3225e5cabe Mon Sep 17 00:00:00 2001 From: Gabriele Date: Fri, 30 Sep 2016 16:25:02 -0400 Subject: [PATCH] Add ethernet-link-oam mapping to nxos_feature (#4956) * Add ethernet-link-oam mapping * Adding port-secutiry mapping * Fixing command output format --- .../modules/network/nxos/nxos_feature.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nxos/nxos_feature.py b/lib/ansible/modules/network/nxos/nxos_feature.py index 9752e10fe47..233915e6d45 100644 --- a/lib/ansible/modules/network/nxos/nxos_feature.py +++ b/lib/ansible/modules/network/nxos/nxos_feature.py @@ -813,6 +813,19 @@ def execute_show(cmds, module, command_type=None): clie = get_exception() module.fail_json(msg='Error sending {0}'.format(cmds), error=str(clie)) + except AttributeError: + try: + if command_type: + command_type = command_type_map.get(command_type) + module.cli.add_commands(cmds, output=command_type) + response = module.cli.run_commands() + else: + module.cli.add_commands(cmds, raw=True) + response = module.cli.run_commands() + except ShellError: + clie = get_exception() + module.fail_json(msg='Error sending {0}'.format(cmds), + error=str(clie)) return response @@ -908,7 +921,10 @@ def validate_feature(module, mode='show'): 'sla sender': 'sla_sender', 'ssh': 'sshServer', 'tacacs+': 'tacacs', - 'telnet': 'telnetServer'}, + 'telnet': 'telnetServer', + 'ethernet-link-oam': 'elo', + 'port-security': 'eth_port_sec' + }, 'config': { 'nve': 'nv overlay', @@ -922,6 +938,8 @@ def validate_feature(module, mode='show'): 'sshServer': 'ssh', 'tacacs': 'tacacs+', 'telnetServer': 'telnet', + 'elo': 'ethernet-link-oam', + 'eth_port_sec': 'port-security' } }