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