From 4e497b10b0cb6015b095861cc0287cd2506ebdf9 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 4 Apr 2016 08:10:22 -0400 Subject: [PATCH] bugfix in netcfg to handle multilevel commands this fixes a bug where netcfg would not properly find a statement that was more than one level deep --- lib/ansible/module_utils/netcfg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/netcfg.py b/lib/ansible/module_utils/netcfg.py index a94b1c2512..2deaba8c0f 100644 --- a/lib/ansible/module_utils/netcfg.py +++ b/lib/ansible/module_utils/netcfg.py @@ -174,7 +174,8 @@ class NetworkConfig(object): def get_object(self, path): for item in self.items: if item.text == path[-1]: - if item.parents == path[:-1]: + parents = [p.text for p in item.parents] + if parents == path[:-1]: return item def get_children(self, path):