1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

bug fix in netcfg replace method to handle whitespace argument

This commit is contained in:
Peter Sprygada 2016-06-22 09:29:12 -05:00
parent 54db1df244
commit 6b8c24e0f8

View file

@ -317,7 +317,9 @@ class NetworkConfig(object):
for item in self.items: for item in self.items:
for regexp in patterns: for regexp in patterns:
string = ignore_whitespace is True and item.text or item.raw string = item.raw
if ignore_whitespace is True:
string = item.text
if regexp.search(item.text): if regexp.search(item.text):
if item.text != replace: if item.text != replace:
if parents == [p.text for p in item.parents]: if parents == [p.text for p in item.parents]: