ios_facts: Strip header from running-config (#48047)
IOS prepends a show running-config with lines that are not part of the configuration, keeping the output from being an entirely valid configuration: R1#show run Building configuration... Current configuration : 2045 bytes ... In order to be able to use the config from ios_facts as-is, strip this header.
This commit is contained in:
parent
ae7b9ea8cd
commit
3cc1b8d7d3
1 changed files with 3 additions and 0 deletions
|
@ -282,6 +282,9 @@ class Config(FactsBase):
|
||||||
super(Config, self).populate()
|
super(Config, self).populate()
|
||||||
data = self.responses[0]
|
data = self.responses[0]
|
||||||
if data:
|
if data:
|
||||||
|
data = re.sub(
|
||||||
|
r'^Building configuration...\s+Current configuration : \d+ bytes\n',
|
||||||
|
'', data, flags=re.MULTILINE)
|
||||||
self.facts['config'] = data
|
self.facts['config'] = data
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue