summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrishna Guha <trishnaguha17@gmail.com>2018-07-05 22:12:12 +0530
committerMatt Davis <nitzmahone@users.noreply.github.com>2018-07-05 09:42:12 -0700
commitdc6a1876033ce83742635006a89bdf9d8b4b3202 (patch)
tree262b65d80d74a834c90fe432c6b71508399956dd
parent0fa56ed65d4dba2cf4050a0448dc63938e3572e7 (diff)
downloadansible-dc6a1876033ce83742635006a89bdf9d8b4b3202.tar.gz
nxos and eos bugfix pick-2.5 (#42289)
* fix nxos_vxlan_vtep_vni issue (#42183) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 981c9f6a79404252390efc65410811bd7f483d9b) * Update eos_l2_interface.py (#42270) (cherry picked from commit 51092c6ea52c2b051434d2f997dfa2167114410b) * update changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
-rw-r--r--changelogs/fragments/eos_l2_interface_fix_2.5.6.yaml2
-rw-r--r--changelogs/fragments/nxos_vxlan_vtep_vni_fix_2.5.6.yaml2
-rw-r--r--lib/ansible/modules/network/eos/eos_l2_interface.py5
-rw-r--r--lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py5
4 files changed, 10 insertions, 4 deletions
diff --git a/changelogs/fragments/eos_l2_interface_fix_2.5.6.yaml b/changelogs/fragments/eos_l2_interface_fix_2.5.6.yaml
new file mode 100644
index 0000000000..ff56aae9e2
--- /dev/null
+++ b/changelogs/fragments/eos_l2_interface_fix_2.5.6.yaml
@@ -0,0 +1,2 @@
+bugfixes:
+- Fix eos_l2_interface eapi (https://github.com/ansible/ansible/pull/42270)
diff --git a/changelogs/fragments/nxos_vxlan_vtep_vni_fix_2.5.6.yaml b/changelogs/fragments/nxos_vxlan_vtep_vni_fix_2.5.6.yaml
new file mode 100644
index 0000000000..a50f662633
--- /dev/null
+++ b/changelogs/fragments/nxos_vxlan_vtep_vni_fix_2.5.6.yaml
@@ -0,0 +1,2 @@
+bugfixes:
+- Fix nxos_vxlan_vtep_vni (https://github.com/ansible/ansible/pull/42240).
diff --git a/lib/ansible/modules/network/eos/eos_l2_interface.py b/lib/ansible/modules/network/eos/eos_l2_interface.py
index 4ebb64f4d7..a8fe9cecc4 100644
--- a/lib/ansible/modules/network/eos/eos_l2_interface.py
+++ b/lib/ansible/modules/network/eos/eos_l2_interface.py
@@ -207,8 +207,9 @@ def map_config_to_obj(module):
instances = list()
for item in set(match):
- command = 'sh int {0} switchport | include Switchport'
- switchport_cfg = run_commands(module, command.format(item))[0].split(':')[1].strip()
+ command = {'command': 'show interfaces {0} switchport | include Switchport'.format(item),
+ 'output': 'text'}
+ switchport_cfg = run_commands(module, command)[0].split(':')[1].strip()
if switchport_cfg == 'Enabled':
state = 'present'
else:
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 99475158b4..645671a675 100644
--- a/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py
+++ b/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py
@@ -224,11 +224,12 @@ def state_present(module, existing, proposed, candidate):
evalue = existing_commands.get(key)
dvalue = PARAM_TO_DEFAULT_KEYMAP.get('ingress_replication', 'default')
if value != dvalue:
- if evalue != dvalue:
+ if evalue and 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))
+ if evalue:
+ commands.append('no {0} {1}'.format(key, evalue))
elif value is True:
commands.append(key)