From 41d999998d0a87f619852d4826c1d421479f5bb3 Mon Sep 17 00:00:00 2001 From: Albert Siersema Date: Thu, 17 Jan 2019 13:18:24 +0100 Subject: [PATCH] Match VLAN ID as whole line instead of searching for digits in line (#51019) Searching for digits somewhere in the output line will also match VLAN name (lines) starting with digits. Fixes issue #50998 (cherry picked from commit b1c295386fce205e1f88f2ea89b644293185949e) --- lib/ansible/modules/network/nxos/nxos_vlan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nxos/nxos_vlan.py b/lib/ansible/modules/network/nxos/nxos_vlan.py index a9065bee125..60752783564 100644 --- a/lib/ansible/modules/network/nxos/nxos_vlan.py +++ b/lib/ansible/modules/network/nxos/nxos_vlan.py @@ -576,7 +576,7 @@ def map_config_to_obj(module): if len(line) > 0: line = line.strip() if line[0].isdigit(): - match = re.search(r'(\d+)', line, re.M) + match = re.search(r'^(\d+)$', line, re.M) if match: v = match.group(1) pos1 = splitted_line.index(v)