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
This commit is contained in:
Peter Sprygada 2016-09-23 16:09:14 -04:00 committed by GitHub
parent d843204575
commit 13c7288aea

View file

@ -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: