summaryrefslogtreecommitdiff
path: root/network/nxos
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2016-09-23 16:09:14 -0400
committerGitHub <noreply@github.com>2016-09-23 16:09:14 -0400
commit13c7288aeaf00f9eea441576cf4475a6f993168a (patch)
tree382638dc3ef129ddcd9b733a6cbe7d14afd5021e /network/nxos
parentd843204575952a57e7e866bf21f93d6eb957ce04 (diff)
downloadansible-modules-core-13c7288aeaf00f9eea441576cf4475a6f993168a.tar.gz
fixes exception raised when nxos_facts uses nxapi transport (#4988)
This fixes a condition where an exception is raised when collecting `interface` facts and the transport is set to nxapi in the nxos_nxapi module. fixes ansible/ansible#17691
Diffstat (limited to 'network/nxos')
-rw-r--r--network/nxos/nxos_facts.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/network/nxos/nxos_facts.py b/network/nxos/nxos_facts.py
index af8df350..ff9c454a 100644
--- a/network/nxos/nxos_facts.py
+++ b/network/nxos/nxos_facts.py
@@ -276,11 +276,11 @@ class Interfaces(FactsBase):
def commands(self):
add_command(self.runner, 'show interface', output='json')
- resp = self.module.cli(['show ipv6 interface | wc lines'])
- if int(resp[0]) > 1:
+ try:
+ self.module.cli('show ipv6 interface', 'json')
add_command(self.runner, 'show ipv6 interface', output='json')
self.ipv6 = True
- else:
+ except NetworkError:
self.ipv6 = False
try: