mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Fix network config line diff ignore (#43924)
* If config is added in form of lines add capability to ignore confgiure lines given as input in task
This commit is contained in:
parent
5f953d1129
commit
522dd923c8
1 changed files with 8 additions and 0 deletions
|
@ -374,6 +374,10 @@ class NetworkConfig(object):
|
||||||
# global config command
|
# global config command
|
||||||
if not parents:
|
if not parents:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
# handle ignore lines
|
||||||
|
if ignore_line(line):
|
||||||
|
continue
|
||||||
|
|
||||||
item = ConfigLine(line)
|
item = ConfigLine(line)
|
||||||
item.raw = line
|
item.raw = line
|
||||||
if item not in self.items:
|
if item not in self.items:
|
||||||
|
@ -399,6 +403,10 @@ class NetworkConfig(object):
|
||||||
|
|
||||||
# add child objects
|
# add child objects
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
# handle ignore lines
|
||||||
|
if ignore_line(line):
|
||||||
|
continue
|
||||||
|
|
||||||
# check if child already exists
|
# check if child already exists
|
||||||
for child in ancestors[-1]._children:
|
for child in ancestors[-1]._children:
|
||||||
if child.text == line:
|
if child.text == line:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue