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.
reviewable/pr18780/r1
Peter Sprygada 9 years ago
parent 11056c8ed2
commit e3ca92e97d

@ -166,15 +166,12 @@ def build_candidate(lines, parents, config, strategy):
candidate = list() candidate = list()
if strategy == 'strict': if strategy == 'strict':
if len(lines) != len(config): for index, cmd in enumerate(lines):
candidate = list(lines) try:
else: if cmd != config[index]:
for index, cmd in enumerate(lines):
try:
if cmd != config[index]:
candidate.append(cmd)
except IndexError:
candidate.append(cmd) candidate.append(cmd)
except IndexError:
candidate.append(cmd)
elif strategy == 'exact': elif strategy == 'exact':
if len(lines) != len(config): if len(lines) != len(config):

Loading…
Cancel
Save