mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Don't accept undocumented "p1;p2" patterns; note in changelog
The correct (and now only) way to say p1 OR p2 is "p1:p2".
This commit is contained in:
parent
8aaa06dd50
commit
eff33bac49
2 changed files with 10 additions and 5 deletions
|
@ -178,10 +178,11 @@ class Inventory(object):
|
|||
applied subsets.
|
||||
"""
|
||||
|
||||
# process patterns
|
||||
# Enumerate all hosts matching the given pattern (which may be
|
||||
# either a list of patterns or a string like 'pat1:pat2').
|
||||
if isinstance(pattern, list):
|
||||
pattern = ';'.join(pattern)
|
||||
patterns = self._split_pattern(pattern.replace(";",":"))
|
||||
pattern = ':'.join(pattern)
|
||||
patterns = self._split_pattern(pattern)
|
||||
hosts = self._get_hosts(patterns)
|
||||
|
||||
# exclude hosts not in a subset, if defined
|
||||
|
@ -520,8 +521,7 @@ class Inventory(object):
|
|||
if subset_pattern is None:
|
||||
self._subset = None
|
||||
else:
|
||||
subset_pattern = subset_pattern.replace(',',':')
|
||||
subset_patterns = self._split_pattern(subset_pattern.replace(";",":"))
|
||||
subset_patterns = self._split_pattern(subset_pattern)
|
||||
results = []
|
||||
# allow Unix style @filename data
|
||||
for x in subset_patterns:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue