Running stage 2 fails with an exception related to a bad character range
This document (000020288) is provided subject to the disclaimer at the end of this document.
Environment
Situation
File "/usr/lib/python3.6/site-packages/salt/client/mixins.py", line 385, in low
data['return'] = func(*args, **kwargs)
File "/srv/modules/runners/push.py", line 82, in proposal
common = pillar_data.organize(filename)
File "/srv/modules/runners/push.py", line 221, in organize
proposal_files = _parse(self.proposals_dir + "/" + line)
File "/srv/modules/runners/push.py", line 301, in _parse
files = glob.glob(line)
files = glob.glob(line)
File "/usr/lib64/python3.6/glob.py", line 20, in glob
return list(iglob(pathname, recursive=recursive))
File "/usr/lib64/python3.6/glob.py", line 72, in _iglob
for name in glob_in_dir(dirname, basename, dironly):
File "/usr/lib64/python3.6/glob.py", line 83, in _glob1
return fnmatch.filter(names, pattern)
File "/usr/lib64/python3.6/fnmatch.py", line 52, in filter
match = _compile_pattern(pat)
File "/usr/lib64/python3.6/fnmatch.py", line 46, in _compile_pattern
return re.compile(res).match
File "/usr/lib64/python3.6/re.py", line 233, in compile
return _compile(pattern, flags)
File "/usr/lib64/python3.6/re.py", line 301, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib64/python3.6/sre_compile.py", line 562, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib64/python3.6/sre_parse.py", line 855, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib64/python3.6/sre_parse.py", line 416, in _parse_sub
not nested and not items))
File "/usr/lib64/python3.6/sre_parse.py", line 765, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
File "/usr/lib64/python3.6/sre_parse.py", line 416, in _parse_sub
not nested and not items))
File "/usr/lib64/python3.6/sre_parse.py", line 553, in _parse
raise source.error(msg, len(this) + 1 + len(that))
sre_constants.error: bad character range 2-1 at position 9
Resolution
Cause
Additional Information
role-storage/cluster/node[2-18]*.sls
Specifying something like [2-18] as per the above is not interpreted as any number between 2 and 18 as would be expected, it's interpreted as the character range 2-1 which is invalid, because it's backwards (hence the exception), plus the character 8.
For the above example, one possible solution while still using globbing is to specify the minions as follows instead:
role-storage/cluster/node1[0-8]*.sls
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020288
- Creation Date: 16-Jun-2021
- Modified Date:16-Jun-2021
-
- SUSE Enterprise Storage
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com