mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add deprecation warning regarding host patterns
This commit is contained in:
parent
6bf6b9fdbb
commit
32034feec5
1 changed files with 10 additions and 0 deletions
|
@ -34,6 +34,12 @@ from ansible.inventory.host import Host
|
|||
from ansible.plugins import vars_loader
|
||||
from ansible.utils.vars import combine_vars
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
except ImportError:
|
||||
from ansible.utils.display import Display
|
||||
display = Display()
|
||||
|
||||
class Inventory(object):
|
||||
"""
|
||||
Host inventory for ansible.
|
||||
|
@ -183,6 +189,10 @@ class Inventory(object):
|
|||
# either a list of patterns or a string like 'pat1:pat2').
|
||||
if isinstance(pattern, list):
|
||||
pattern = ':'.join(pattern)
|
||||
|
||||
if ';' in pattern or ',' in pattern:
|
||||
display.deprecated("The use of ',' or ';' in host patterns has been removed", version=2.0, removed=True)
|
||||
|
||||
patterns = self._split_pattern(pattern)
|
||||
hosts = self._evaluate_patterns(patterns)
|
||||
|
||||
|
|
Loading…
Reference in a new issue