From e1914a0e62e6fcaed1342ffbf951ed0e0123c068 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 7 May 2012 21:46:36 -0400 Subject: [PATCH] Revert "fix the get_hosts() error in get_groups returning a dict not a list of group objects" This reverts commit f41fb90d78fa464e9ad90b63a64bbd48e240c8c2. --- lib/ansible/inventory.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ansible/inventory.py b/lib/ansible/inventory.py index b707b1596f..a279c080b2 100644 --- a/lib/ansible/inventory.py +++ b/lib/ansible/inventory.py @@ -73,14 +73,14 @@ class Inventory(object): hosts = {} patterns = pattern.replace(";",":").split(":") - for (groupname, group) in self.get_groups().items(): - for host in group.get_hosts(): - for pat in patterns: - if group.name == pat or pat == 'all' or self._match(host.name, pat): - if not self._restriction: - hosts[host.name] = host - if self._restriction and host.name in self._restriction: - hosts[host.name] = host + for group in self.get_groups(): + for host in group.get_hosts(): + for pat in patterns: + if group.name == pat or pat == 'all' or self._match(host.name, pat): + if not self._restriction: + hosts[host.name] = host + if self._restriction and host.name in self._restriction: + hosts[host.name] = host return sorted(hosts.values(), key=lambda x: x.name) def get_groups(self):