mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Fix inventory.get_hosts when hosts is a list.
This commit is contained in:
parent
565f336182
commit
1f8696f5c1
2 changed files with 11 additions and 1 deletions
|
@ -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("!") ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue