From b1c295386fce205e1f88f2ea89b644293185949e 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 --- 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 cb497eb535b..0d2df3f6408 100644 --- a/lib/ansible/modules/network/nxos/nxos_vlan.py +++ b/lib/ansible/modules/network/nxos/nxos_vlan.py @@ -580,7 +580,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)