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#17691pull/4420/head
parent
27759ee58f
commit
654a38897f
|
@ -276,11 +276,11 @@ class Interfaces(FactsBase):
|
||||||
def commands(self):
|
def commands(self):
|
||||||
add_command(self.runner, 'show interface', output='json')
|
add_command(self.runner, 'show interface', output='json')
|
||||||
|
|
||||||
resp = self.module.cli(['show ipv6 interface | wc lines'])
|
try:
|
||||||
if int(resp[0]) > 1:
|
self.module.cli('show ipv6 interface', 'json')
|
||||||
add_command(self.runner, 'show ipv6 interface', output='json')
|
add_command(self.runner, 'show ipv6 interface', output='json')
|
||||||
self.ipv6 = True
|
self.ipv6 = True
|
||||||
else:
|
except NetworkError:
|
||||||
self.ipv6 = False
|
self.ipv6 = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue