Added support for Cisco stacks in ios_facts.py (#33714)

pull/34107/head
kalimsshar 7 years ago committed by Nathaniel Case
parent 2e76c89910
commit 4086cb4b25

@ -194,9 +194,13 @@ class Default(FactsBase):
return match.group(1)
def parse_model(self, data):
match = re.search(r'^Cisco (.+) \(revision', data, re.M)
match = re.findall(r'^Model number\s+: (\S+)', data, re.M)
if match:
return match.group(1)
return match
else:
match = re.search(r'^[Cc]isco (\S+).+bytes of memory', data, re.M)
if match:
return [match.group(1)]
def parse_image(self, data):
match = re.search(r'image file is "(.+)"', data)
@ -204,9 +208,13 @@ class Default(FactsBase):
return match.group(1)
def parse_serialnum(self, data):
match = re.search(r'board ID (\S+)', data)
match = re.findall(r'^System serial number\s+: (\S+)', data, re.M)
if match:
return match.group(1)
return match
else:
match = re.search(r'board ID (\S+)', data)
if match:
return [match.group(1)]
class Hardware(FactsBase):

Loading…
Cancel
Save