summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriele <gabrielegerbino@gmail.com>2017-02-14 18:10:46 +0100
committerNathaniel Case <Qalthos@gmail.com>2017-02-14 12:22:14 -0500
commit4cc2a9d9d74d990930ecb639ee9f51281dc42781 (patch)
tree45c6c58fa65c072006c10d593b28a9486702c3da
parent72194a29dccd8216cb5e1940addc84cb167fa36f (diff)
downloadansible-modules-core-4cc2a9d9d74d990930ecb639ee9f51281dc42781.tar.gz
Fixing nxos modules when interface is loopback (#20645)
* Fixing modules when interface is loopback * Remove capitalize
-rw-r--r--network/nxos/nxos_interface_ospf.py3
-rw-r--r--network/nxos/nxos_vrf_interface.py4
2 files changed, 6 insertions, 1 deletions
diff --git a/network/nxos/nxos_interface_ospf.py b/network/nxos/nxos_interface_ospf.py
index cb1fa6c0..bcf910cd 100644
--- a/network/nxos/nxos_interface_ospf.py
+++ b/network/nxos/nxos_interface_ospf.py
@@ -606,6 +606,9 @@ def main():
'message_digest_password']],
supports_check_mode=True)
+ if not module.params['interface'].startswith('loopback'):
+ module.params['interface'] = module.params['interface'].capitalize()
+
for param in ['message_digest_encryption_type',
'message_digest_algorithm_type',
'message_digest_password']:
diff --git a/network/nxos/nxos_vrf_interface.py b/network/nxos/nxos_vrf_interface.py
index 28f5d4ed..a8b5a855 100644
--- a/network/nxos/nxos_vrf_interface.py
+++ b/network/nxos/nxos_vrf_interface.py
@@ -370,7 +370,9 @@ def get_vrf_list(module):
def get_interface_info(interface, module):
- command = 'show run | section interface.{0}'.format(interface.capitalize())
+ if not interface.startswith('loopback'):
+ interface = interface.capitalize()
+ command = 'show run | section interface.{0}'.format(interface)
vrf_regex = ".*vrf\s+member\s+(?P<vrf>\S+).*"
try: