mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-06-23 10:18:45 +02:00
Fix bug in preprocessing when wrapped line is appended to a non-existing entry. (#177)
This commit is contained in:
parent
2b8c66b983
commit
42ea132d60
2 changed files with 4 additions and 2 deletions
2
changelogs/fragments/177-facts-parsing.yml
Normal file
2
changelogs/fragments/177-facts-parsing.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- "facts - do not crash in CLI output preprocessing in unexpected situations during line unwrapping (https://github.com/ansible-collections/community.routeros/issues/170, https://github.com/ansible-collections/community.routeros/pull/177)."
|
|
@ -391,7 +391,7 @@ class Interfaces(FactsBase):
|
|||
for line in data.split('\n'):
|
||||
if len(line) == 0 or line[:5] == 'Flags':
|
||||
continue
|
||||
elif not re.match(self.WRAPPED_LINE_RE, line):
|
||||
elif not preprocessed or not re.match(self.WRAPPED_LINE_RE, line):
|
||||
preprocessed.append(line)
|
||||
else:
|
||||
preprocessed[-1] += line
|
||||
|
@ -468,7 +468,7 @@ class Routing(FactsBase):
|
|||
for line in data.split('\n'):
|
||||
if len(line) == 0 or line[:5] == 'Flags':
|
||||
continue
|
||||
elif not re.match(self.WRAPPED_LINE_RE, line):
|
||||
elif not preprocessed or not re.match(self.WRAPPED_LINE_RE, line):
|
||||
preprocessed.append(line)
|
||||
else:
|
||||
preprocessed[-1] += line
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue