Added support for Cisco stacks in ios_facts.py (#33714)
This commit is contained in:
parent
2e76c89910
commit
4086cb4b25
1 changed files with 12 additions and 4 deletions
|
@ -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…
Reference in a new issue