From 981c9f6a79404252390efc65410811bd7f483d9b Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Mon, 2 Jul 2018 19:32:29 +0530 Subject: [PATCH] fix nxos_vxlan_vtep_vni issue (#42183) Signed-off-by: Trishna Guha --- .../modules/network/nxos/nxos_vxlan_vtep_vni.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py b/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py index 01fddf069d..6558106cfa 100644 --- a/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py +++ b/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py @@ -212,12 +212,13 @@ def state_present(module, existing, proposed, candidate): elif key == 'ingress-replication protocol' and value != existing_commands.get(key): evalue = existing_commands.get(key) dvalue = PARAM_TO_DEFAULT_KEYMAP.get('ingress_replication', 'default') - if value != dvalue: - if evalue != dvalue: + if evalue: + if value != dvalue: + if evalue != dvalue: + commands.append('no {0} {1}'.format(key, evalue)) + commands.append('{0} {1}'.format(key, value)) + else: commands.append('no {0} {1}'.format(key, evalue)) - commands.append('{0} {1}'.format(key, value)) - else: - commands.append('no {0} {1}'.format(key, evalue)) elif value is True: commands.append(key)