Skip to content

Commit

Permalink
Bug module wrapper regex (#806)
Browse files Browse the repository at this point in the history
* Fix regex in ModuleWrapperCatElem to account for versioned modules

* Convert dashes to underscores in version names
  • Loading branch information
hwikle-lanl authored Jan 31, 2025
1 parent 9b5ff93 commit 7caf955
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pavilion/module_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def _load(self, var_man: VariableSetManager, req_name: str, version: str) \
actions.append(ModuleLoad(module_name=mod_name, version=mod_vers))

env_vars = collections.OrderedDict()
vers_var_name = '{}_VERSION'.format(self.name.replace('*', 'any'))
vers_var_name = '{}_VERSION'.format(self.name.replace('*', 'any').replace('-', '_'))
if version:
env_vars[vers_var_name] = version
else:
Expand Down
2 changes: 1 addition & 1 deletion lib/pavilion/test_config/file_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class TestCatElem(yc.CategoryElem):
class ModuleWrapperCatElem(yc.CategoryElem):
"""Allow glob wildcards in key names."""

_NAME_RE = re.compile(r'^[a-zA-Z*?+][a-zA-Z0-9_*+?-]*$')
_NAME_RE = re.compile(r'^[a-zA-Z*?+][a-zA-Z0-9_*+?-]*(/[a-zA-Z0-9._-]+)?$')
type=OrderedDict


Expand Down

0 comments on commit 7caf955

Please sign in to comment.