Fix inventory.get_hosts when hosts is a list.

This commit is contained in:
John Kleint 2012-09-11 13:00:40 -04:00
commit 1f8696f5c1
2 changed files with 11 additions and 1 deletions

View file

@ -96,7 +96,9 @@ class Inventory(object):
applied subsets.
"""
# process patterns
# process patterns
if isinstance(pattern, list):
pattern = ';'.join(pattern)
patterns = pattern.replace(";",":").split(":")
positive_patterns = [ p for p in patterns if not p.startswith("!") ]
negative_patterns = [ p for p in patterns if p.startswith("!") ]