show version brief does not work on iosxr virtual (#37609)
* show version brief does not work on iosxr virtual * ci failures fix
This commit is contained in:
parent
73d3ed85ef
commit
66b389a00d
4 changed files with 24 additions and 5 deletions
|
@ -136,12 +136,12 @@ class FactsBase(object):
|
||||||
class Default(FactsBase):
|
class Default(FactsBase):
|
||||||
|
|
||||||
def commands(self):
|
def commands(self):
|
||||||
return(['show version brief'])
|
return(['show version | utility head -n 20'])
|
||||||
|
|
||||||
def populate(self, results):
|
def populate(self, results):
|
||||||
self.facts['version'] = self.parse_version(results['show version brief'])
|
self.facts['version'] = self.parse_version(results['show version | utility head -n 20'])
|
||||||
self.facts['image'] = self.parse_image(results['show version brief'])
|
self.facts['image'] = self.parse_image(results['show version | utility head -n 20'])
|
||||||
self.facts['hostname'] = self.parse_hostname(results['show version brief'])
|
self.facts['hostname'] = self.parse_hostname(results['show version | utility head -n 20'])
|
||||||
|
|
||||||
def parse_version(self, data):
|
def parse_version(self, data):
|
||||||
match = re.search(r'Version (\S+)$', data, re.M)
|
match = re.search(r'Version (\S+)$', data, re.M)
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Cliconf(CliconfBase):
|
||||||
device_info = {}
|
device_info = {}
|
||||||
|
|
||||||
device_info['network_os'] = 'iosxr'
|
device_info['network_os'] = 'iosxr'
|
||||||
reply = self.get(b'show version brief')
|
reply = self.get(b'show version | utility head -n 20')
|
||||||
data = to_text(reply, errors='surrogate_or_strict').strip()
|
data = to_text(reply, errors='surrogate_or_strict').strip()
|
||||||
|
|
||||||
match = re.search(r'Version (\S+)$', data, re.M)
|
match = re.search(r'Version (\S+)$', data, re.M)
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
Cisco IOS XR Software, Version 6.0.0[Default]
|
||||||
|
Copyright (c) 2015 by Cisco Systems, Inc.
|
||||||
|
|
||||||
|
ROM: GRUB, Version 1.99(0), DEV RELEASE
|
||||||
|
|
||||||
|
iosxr01 uptime is 11 weeks, 6 days, 2 hours, 2 minutes
|
||||||
|
System image file is "bootflash:disk0/xrvr-os-mbi-6.0.0/mbixrvr-rp.vm"
|
||||||
|
|
||||||
|
cisco IOS XRv Series (Pentium Celeron Stepping 3) processor with 3169911K bytes
|
||||||
|
of memory.
|
||||||
|
Pentium Celeron Stepping 3 processor at 3836MHz, Revision 2.174
|
||||||
|
IOS XRv Chassis
|
||||||
|
|
||||||
|
1 Management Ethernet
|
||||||
|
6 GigabitEthernet
|
||||||
|
97070k bytes of non-volatile configuration memory.
|
||||||
|
866M bytes of hard disk.
|
||||||
|
2321392k bytes of disk0: (Sector size 512 bytes).
|
|
@ -57,6 +57,7 @@ class TestIosxrFacts(TestIosxrModule):
|
||||||
command = item
|
command = item
|
||||||
filename = str(command).replace(' ', '_')
|
filename = str(command).replace(' ', '_')
|
||||||
filename = filename.replace('/', '7')
|
filename = filename.replace('/', '7')
|
||||||
|
filename = filename.replace('|', '_')
|
||||||
output.append(load_fixture(filename))
|
output.append(load_fixture(filename))
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue