mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Introduce _split_pattern to parse an "x:y:z" pattern
This function takes a string like 'foo:bar[1:2]:baz[x:y]-quux' and returns a list of patterns ['foo', 'bar[1:2]', 'baz[x:y]-quux'], i.e. splits the string on colons that are not part of a range specification.
This commit is contained in:
committed by
James Cammarata
parent
32034feec5
commit
1437b8e120
@@ -533,7 +533,12 @@ class Inventory(object):
|
||||
if subset_pattern is None:
|
||||
self._subset = None
|
||||
else:
|
||||
<<<<<<< HEAD
|
||||
subset_patterns = self._split_pattern(subset_pattern)
|
||||
=======
|
||||
subset_pattern = subset_pattern.replace(',',':')
|
||||
subset_patterns = self._split_pattern(subset_pattern.replace(";",":"))
|
||||
>>>>>>> Introduce _split_pattern to parse an "x:y:z" pattern
|
||||
results = []
|
||||
# allow Unix style @filename data
|
||||
for x in subset_patterns:
|
||||
|
||||
Reference in New Issue
Block a user