From b0a9308e0d462bb2d5a52ab1b7ece3dfe0d040a8 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 --- lib/ansible/modules/network/nxos/nxos_config.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_config.py b/lib/ansible/modules/network/nxos/nxos_config.py index 7bb4476b25e..1ecd2ea935d 100644 --- a/lib/ansible/modules/network/nxos/nxos_config.py +++ b/lib/ansible/modules/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):