From 11056c8ed236a30acfbf9198c21516a6a171995c Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Thu, 10 Mar 2016 07:14:41 -0500 Subject: [PATCH] bugfix for handling match=strict in eos_config Resolves an issue where match=strict would act like match=exact when evaluating the configuration --- network/eos/eos_config.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/network/eos/eos_config.py b/network/eos/eos_config.py index 1b4ae4e1366..8b51c37f550 100644 --- a/network/eos/eos_config.py +++ b/network/eos/eos_config.py @@ -165,15 +165,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):