mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
remove deprecation for :, add ; functionality (its deprecated but it should work)
This commit is contained in:
parent
9c09dc3ef8
commit
13bf62d0e6
1 changed files with 2 additions and 5 deletions
|
@ -189,7 +189,8 @@ class Inventory(object):
|
||||||
return list(itertools.chain(*map(cls.split_host_pattern, pattern)))
|
return list(itertools.chain(*map(cls.split_host_pattern, pattern)))
|
||||||
|
|
||||||
if ';' in pattern:
|
if ';' in pattern:
|
||||||
display.deprecated("Use ',' instead of ';' to separate host patterns")
|
patterns = re.split('\s*;\s*', pattern)
|
||||||
|
display.deprecated("Use ',' or ':' instead of ';' to separate host patterns")
|
||||||
|
|
||||||
# If it's got commas in it, we'll treat it as a straightforward
|
# If it's got commas in it, we'll treat it as a straightforward
|
||||||
# comma-separated list of patterns.
|
# comma-separated list of patterns.
|
||||||
|
@ -199,7 +200,6 @@ class Inventory(object):
|
||||||
|
|
||||||
# If it doesn't, it could still be a single pattern. This accounts for
|
# If it doesn't, it could still be a single pattern. This accounts for
|
||||||
# non-separator uses of colons: IPv6 addresses and [x:y] host ranges.
|
# non-separator uses of colons: IPv6 addresses and [x:y] host ranges.
|
||||||
|
|
||||||
else:
|
else:
|
||||||
(base, port) = parse_address(pattern, allow_ranges=True)
|
(base, port) = parse_address(pattern, allow_ranges=True)
|
||||||
if base:
|
if base:
|
||||||
|
@ -219,9 +219,6 @@ class Inventory(object):
|
||||||
''', pattern, re.X
|
''', pattern, re.X
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(patterns) > 1:
|
|
||||||
display.deprecated("Use ',' instead of ':' to separate host patterns")
|
|
||||||
|
|
||||||
return [p.strip() for p in patterns]
|
return [p.strip() for p in patterns]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue