From 0ad6ac408654eda92a45042110c209d1700abfa7 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 9 Feb 2013 22:52:35 -0500 Subject: [PATCH] Fix group depth for nested groups --- lib/ansible/inventory/group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/group.py b/lib/ansible/inventory/group.py index a460b483ef..6f06cb0762 100644 --- a/lib/ansible/inventory/group.py +++ b/lib/ansible/inventory/group.py @@ -36,7 +36,7 @@ class Group(object): if self == group: raise Exception("can't add group to itself") self.child_groups.append(group) - group.depth = group.depth + 1 + group.depth = max([self.depth+1, group.depth]) group.parent_groups.append(self) def add_host(self, host):