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:
Abhijit Menon-Sen 2015-08-13 16:32:11 +05:30 committed by James Cammarata
parent 32034feec5
commit 1437b8e120

View file

@ -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: