From 7c96f1d803692b4b5e5f57ce663aecb1e09263dc Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Fri, 8 Aug 2014 08:54:11 +0200 Subject: [PATCH] InventoryDir: fixing yet another corner case --- lib/ansible/inventory/dir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/dir.py b/lib/ansible/inventory/dir.py index 97a0fb9ea2..9ac23fff89 100644 --- a/lib/ansible/inventory/dir.py +++ b/lib/ansible/inventory/dir.py @@ -113,7 +113,7 @@ class InventoryDirectory(object): for group in allgroup.child_groups[:]: # groups might once have beeen added to all, and later be added # to another group: we need to remove the link wit all then - if len(group.parent_groups) > 1: + if len(group.parent_groups) > 1 and allgroup in group.parent_groups: # real children of all have just 1 parent, all # this one has more, so not a direct child of all anymore group.parent_groups.remove(allgroup)