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:
parent
32034feec5
commit
1437b8e120
1 changed files with 5 additions and 0 deletions
|
@ -533,7 +533,12 @@ class Inventory(object):
|
||||||
if subset_pattern is None:
|
if subset_pattern is None:
|
||||||
self._subset = None
|
self._subset = None
|
||||||
else:
|
else:
|
||||||
|
<<<<<<< HEAD
|
||||||
subset_patterns = self._split_pattern(subset_pattern)
|
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 = []
|
results = []
|
||||||
# allow Unix style @filename data
|
# allow Unix style @filename data
|
||||||
for x in subset_patterns:
|
for x in subset_patterns:
|
||||||
|
|
Loading…
Reference in a new issue