mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
bugfix for ios_config module
This commit address a bug in the ios_config module when using the match: strict argument. When the argument is used, the module will compare the configuration block same as match: exact which is not the intended behavior. This commit updates the behavior to propertly handle the strict argument.
This commit is contained in:
parent
761724f5c3
commit
ba41260ae0
1 changed files with 5 additions and 8 deletions
|
@ -166,15 +166,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