From d7d76f3aafc167d4c840334829ddb3c8fb2923e2 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Thu, 23 Mar 2017 19:57:24 -0700 Subject: [PATCH] Fixing nxos_vrf_interface when interface name is not full (#22769) --- lib/ansible/modules/network/nxos/nxos_vrf_interface.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/modules/network/nxos/nxos_vrf_interface.py b/lib/ansible/modules/network/nxos/nxos_vrf_interface.py index 3386a908f4a..8510de334c1 100644 --- a/lib/ansible/modules/network/nxos/nxos_vrf_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_vrf_interface.py @@ -173,6 +173,10 @@ def get_vrf_list(module): def get_interface_info(interface, module): if not interface.startswith('loopback'): interface = interface.capitalize() + + interface_type = get_interface_type(interface) + intf_module = re.split('\d+', interface)[0] + intf_name = interface_type + interface.split(intf_module)[1] command = 'show run | section interface.{0}'.format(interface) vrf_regex = ".*vrf\s+member\s+(?P\S+).*"