show version brief does not work on iosxr virtual (#37609)

* show version brief does not work on iosxr virtual

* ci failures fix
pull/38034/merge
Deepak Agrawal 7 years ago committed by GitHub
parent 73d3ed85ef
commit 66b389a00d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -136,12 +136,12 @@ class FactsBase(object):
class Default(FactsBase):
def commands(self):
return(['show version brief'])
return(['show version | utility head -n 20'])
def populate(self, results):
self.facts['version'] = self.parse_version(results['show version brief'])
self.facts['image'] = self.parse_image(results['show version brief'])
self.facts['hostname'] = self.parse_hostname(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 | utility head -n 20'])
self.facts['hostname'] = self.parse_hostname(results['show version | utility head -n 20'])
def parse_version(self, data):
match = re.search(r'Version (\S+)$', data, re.M)

@ -35,7 +35,7 @@ class Cliconf(CliconfBase):
device_info = {}
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()
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
filename = str(command).replace(' ', '_')
filename = filename.replace('/', '7')
filename = filename.replace('|', '_')
output.append(load_fixture(filename))
return output

Loading…
Cancel
Save