diff --git a/lib/ansible/module_utils/netcfg.py b/lib/ansible/module_utils/netcfg.py index a94b1c2512b..2deaba8c0f6 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):