Commit 227e8e31 by Michael DeHaan

Merge branch 'use_comps' of git://github.com/j2sol/ansible into devel

parents 10350d16 23720ff1
...@@ -133,11 +133,7 @@ class Inventory(object): ...@@ -133,11 +133,7 @@ class Inventory(object):
# exclude hosts not in a subset, if defined # exclude hosts not in a subset, if defined
if self._subset: if self._subset:
subset = self._get_hosts(self._subset) subset = self._get_hosts(self._subset)
new_hosts = [] hosts = [ h for h in hosts if h in subset ]
for h in hosts:
if h in subset and h not in new_hosts:
new_hosts.append(h)
hosts = new_hosts
# exclude hosts mentioned in any restriction (ex: failed hosts) # exclude hosts mentioned in any restriction (ex: failed hosts)
if self._restriction is not None: if self._restriction is not None:
...@@ -183,9 +179,7 @@ class Inventory(object): ...@@ -183,9 +179,7 @@ class Inventory(object):
elif p.startswith("&"): elif p.startswith("&"):
hosts = [ h for h in hosts if h in that ] hosts = [ h for h in hosts if h in that ]
else: else:
for h in that: hosts.extend([ h for h in that if h not in hosts ])
if h not in hosts:
hosts.append(h)
return hosts return hosts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment