From 522dd923c83ae012e5ae41930e0b823ccda834e1 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Wed, 22 Aug 2018 19:40:09 +0530 Subject: [PATCH] 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 --- lib/ansible/module_utils/network/common/config.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ansible/module_utils/network/common/config.py b/lib/ansible/module_utils/network/common/config.py index 3e910955488..40d2272e02c 100644 --- a/lib/ansible/module_utils/network/common/config.py +++ b/lib/ansible/module_utils/network/common/config.py @@ -374,6 +374,10 @@ class NetworkConfig(object): # global config command if not parents: for line in lines: + # handle ignore lines + if ignore_line(line): + continue + item = ConfigLine(line) item.raw = line if item not in self.items: @@ -399,6 +403,10 @@ class NetworkConfig(object): # add child objects for line in lines: + # handle ignore lines + if ignore_line(line): + continue + # check if child already exists for child in ancestors[-1]._children: if child.text == line: