From 47141b8426b51f39463041d33d79897cd249d97b Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 14 Feb 2017 20:12:49 -0500 Subject: [PATCH] fixes minor issue with strict diff of network config (#21436) strips leading and trailing spaces for line comparision to prevent fails positiives --- lib/ansible/module_utils/netcfg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/netcfg.py b/lib/ansible/module_utils/netcfg.py index ceea081c448..90180085e3c 100644 --- a/lib/ansible/module_utils/netcfg.py +++ b/lib/ansible/module_utils/netcfg.py @@ -247,9 +247,9 @@ class NetworkConfig(object): updates = list() for index, line in enumerate(self.items): try: - if line != other[index]: + if str(line).strip() != str(other[index]).strip(): updates.append(line) - except IndexError: + except (AttributeError, IndexError): updates.append(line) return updates