From e9ab4d688d5ba0dfe932b769819e87beb3d8e2d0 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Thu, 10 Mar 2016 07:16:52 -0500 Subject: [PATCH] bugfix for handling match=strict in iosxr_config Resolves an issue where match=strict would act like match=exact when evaluating the configuration --- network/iosxr/iosxr_config.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/network/iosxr/iosxr_config.py b/network/iosxr/iosxr_config.py index 24299c593d3..b86e1763318 100644 --- a/network/iosxr/iosxr_config.py +++ b/network/iosxr/iosxr_config.py @@ -153,15 +153,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):