mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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()
|
||||
data = self.responses[0]
|
||||
if data:
|
||||
data = re.sub(
|
||||
r'^Building configuration...\s+Current configuration : \d+ bytes\n',
|
||||
'', data, flags=re.MULTILINE)
|
||||
self.facts['config'] = data
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue