From f94ef0362516db3a0751196ce767933dc0d2eba3 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Mon, 16 Oct 2017 18:19:44 +0530 Subject: [PATCH] Fixes #30529 nxos_facts ipv6 interface (#31286) Signed-off-by: Trishna Guha --- .../modules/network/nxos/nxos_facts.py | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_facts.py b/lib/ansible/modules/network/nxos/nxos_facts.py index 9de6e0f38ec..332c6b4b69d 100644 --- a/lib/ansible/modules/network/nxos/nxos_facts.py +++ b/lib/ansible/modules/network/nxos/nxos_facts.py @@ -348,14 +348,20 @@ class Interfaces(FactsBase): return objects def parse_ipv6_interfaces(self, data): - data = data['TABLE_intf'] - if isinstance(data, dict): - data = [data] - for item in data: - name = item['ROW_intf']['intf-name'] - intf = self.facts['interfaces'][name] - intf['ipv6'] = self.transform_dict(item, self.INTERFACE_IPV6_MAP) - self.facts['all_ipv6_addresses'].append(item['ROW_intf']['addr']) + try: + data = data['TABLE_intf'] + if data: + if isinstance(data, dict): + data = [data] + for item in data: + name = item['ROW_intf']['intf-name'] + intf = self.facts['interfaces'][name] + intf['ipv6'] = self.transform_dict(item, self.INTERFACE_IPV6_MAP) + self.facts['all_ipv6_addresses'].append(item['ROW_intf']['addr']) + else: + return "" + except TypeError: + return "" class Legacy(FactsBase):