1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
This commit is contained in:
Albert Siersema 2019-01-17 13:18:24 +01:00 committed by Trishna Guha
parent 22d914a888
commit b1c295386f

View file

@ -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)