From 1a12e733b9ec2d41f718a8d8384b4dedf03c5c2c Mon Sep 17 00:00:00 2001 From: rahushen Date: Wed, 6 Dec 2017 09:41:31 -0500 Subject: [PATCH] nxos_facts: add check for ipv6 (#33594) --- lib/ansible/modules/network/nxos/nxos_facts.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nxos/nxos_facts.py b/lib/ansible/modules/network/nxos/nxos_facts.py index 443dc1f4699..c9cf6e8a839 100644 --- a/lib/ansible/modules/network/nxos/nxos_facts.py +++ b/lib/ansible/modules/network/nxos/nxos_facts.py @@ -281,6 +281,15 @@ class Interfaces(FactsBase): ('prefix', 'subnet') ]) + def ipv6_structure_op_supported(self): + data = self.run('show version', 'json') + if data: + unsupported_versions = ['I2', 'F1', 'A8'] + for ver in unsupported_versions: + if ver in data.get('kickstart_ver_str'): + return False + return True + def populate(self): self.facts['all_ipv4_addresses'] = list() self.facts['all_ipv6_addresses'] = list() @@ -289,7 +298,7 @@ class Interfaces(FactsBase): if data: self.facts['interfaces'] = self.populate_interfaces(data) - data = self.run('show ipv6 interface', 'json') + data = self.run('show ipv6 interface', 'json') if self.ipv6_structure_op_supported() else None if data and not isinstance(data, string_types): self.parse_ipv6_interfaces(data)