mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
bugfix for handling match=strict in nxos_config
Resolves an issue where match=strict would act like match=exact when evaluating the configuration
This commit is contained in:
parent
90650256ef
commit
b0a9308e0d
1 changed files with 5 additions and 8 deletions
|
@ -168,15 +168,12 @@ def build_candidate(lines, parents, config, strategy):
|
|||
candidate = list()
|
||||
|
||||
if strategy == 'strict':
|
||||
if len(lines) != len(config):
|
||||
candidate = list(lines)
|
||||
else:
|
||||
for index, cmd in enumerate(lines):
|
||||
try:
|
||||
if cmd != config[index]:
|
||||
candidate.append(cmd)
|
||||
except IndexError:
|
||||
for index, cmd in enumerate(lines):
|
||||
try:
|
||||
if cmd != config[index]:
|
||||
candidate.append(cmd)
|
||||
except IndexError:
|
||||
candidate.append(cmd)
|
||||
|
||||
elif strategy == 'exact':
|
||||
if len(lines) != len(config):
|
||||
|
|
Loading…
Reference in a new issue