1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02: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:
Abhijit Menon-Sen 2015-08-13 17:21:53 +05:30 committed by James Cammarata
parent 8aaa06dd50
commit eff33bac49
2 changed files with 10 additions and 5 deletions

View file

@ -166,6 +166,11 @@ Other Notable Changes:
* play output is now dynamically sized to terminal with a minimal of 80 coluumns (old default) * play output is now dynamically sized to terminal with a minimal of 80 coluumns (old default)
* vars_prompt and pause are now skipped with a warning if the play is called non interactively (i.e. pull from cron) * vars_prompt and pause are now skipped with a warning if the play is called non interactively (i.e. pull from cron)
Minor changes:
* The undocumented semicolon-separated "pattern1;pattern2" syntax to
match hosts is no longer supported.
## 1.9.2 "Dancing In the Street" - Jun 26, 2015 ## 1.9.2 "Dancing In the Street" - Jun 26, 2015
* Security fixes to check that hostnames match certificates with https urls (CVE-2015-3908) * Security fixes to check that hostnames match certificates with https urls (CVE-2015-3908)

View file

@ -178,10 +178,11 @@ class Inventory(object):
applied subsets. 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): if isinstance(pattern, list):
pattern = ';'.join(pattern) pattern = ':'.join(pattern)
patterns = self._split_pattern(pattern.replace(";",":")) patterns = self._split_pattern(pattern)
hosts = self._get_hosts(patterns) hosts = self._get_hosts(patterns)
# exclude hosts not in a subset, if defined # exclude hosts not in a subset, if defined
@ -520,8 +521,7 @@ class Inventory(object):
if subset_pattern is None: if subset_pattern is None:
self._subset = None self._subset = None
else: else:
subset_pattern = subset_pattern.replace(',',':') subset_patterns = self._split_pattern(subset_pattern)
subset_patterns = self._split_pattern(subset_pattern.replace(";",":"))
results = [] results = []
# allow Unix style @filename data # allow Unix style @filename data
for x in subset_patterns: for x in subset_patterns: