From 6b8c24e0f8c8966867caced81d514935ebcaff0d Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Wed, 22 Jun 2016 09:29:12 -0500 Subject: [PATCH] bug fix in netcfg replace method to handle whitespace argument --- lib/ansible/module_utils/netcfg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/netcfg.py b/lib/ansible/module_utils/netcfg.py index 71cb57ea65..8a5eb1640a 100644 --- a/lib/ansible/module_utils/netcfg.py +++ b/lib/ansible/module_utils/netcfg.py @@ -317,7 +317,9 @@ class NetworkConfig(object): for item in self.items: 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 item.text != replace: if parents == [p.text for p in item.parents]: