From 13c7288aeaf00f9eea441576cf4475a6f993168a Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Fri, 23 Sep 2016 16:09:14 -0400 Subject: [PATCH] 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 --- network/nxos/nxos_facts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network/nxos/nxos_facts.py b/network/nxos/nxos_facts.py index af8df350710..ff9c454aaa6 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: