mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-21 08:29:08 -07:00
nxos_facts: add check for ipv6 (#33594)
This commit is contained in:
parent
48d3cbfc0f
commit
1a12e733b9
1 changed files with 10 additions and 1 deletions
|
@ -281,6 +281,15 @@ class Interfaces(FactsBase):
|
||||||
('prefix', 'subnet')
|
('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):
|
def populate(self):
|
||||||
self.facts['all_ipv4_addresses'] = list()
|
self.facts['all_ipv4_addresses'] = list()
|
||||||
self.facts['all_ipv6_addresses'] = list()
|
self.facts['all_ipv6_addresses'] = list()
|
||||||
|
@ -289,7 +298,7 @@ class Interfaces(FactsBase):
|
||||||
if data:
|
if data:
|
||||||
self.facts['interfaces'] = self.populate_interfaces(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):
|
if data and not isinstance(data, string_types):
|
||||||
self.parse_ipv6_interfaces(data)
|
self.parse_ipv6_interfaces(data)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue