From 8b215149d4694ab2644df4f231790c3382462d97 Mon Sep 17 00:00:00 2001
From: Serge van Ginderachter <serge@vanginderachter.be>
Date: Wed, 5 Mar 2014 16:24:43 +0100
Subject: [PATCH] inventory directory parser: add groups to parent_groups
 non-recursively

---
 lib/ansible/inventory/dir.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/ansible/inventory/dir.py b/lib/ansible/inventory/dir.py
index 9b53bd17c6..37cc539044 100644
--- a/lib/ansible/inventory/dir.py
+++ b/lib/ansible/inventory/dir.py
@@ -83,8 +83,8 @@ class InventoryDirectory(object):
 
             # This needs to be a second loop to ensure all the parent groups exist
             for name, group in parser.groups.iteritems():
-                for ancestor in group.get_ancestors():
-                    self.groups[ancestor.name].add_child_group(self.groups[name])
+                for parent in group.parent_groups:
+                    self.groups[parent.name].add_child_group(self.groups[name])
 
     def get_host_variables(self, host):
         """ Gets additional host variables from all inventories """