mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-03 17:23:09 +00:00
nxos_facts: add check for ipv6 (#33594)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user