Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add warning whenever a value with a template is replaced by a value without template #4212

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions easybuild/framework/easyconfig/easyconfig.py
Expand Up @@ -1780,6 +1780,10 @@ def get_ref(self, key):
def __setitem__(self, key, value):
"""Set value of specified easyconfig parameter (help text & co is left untouched)"""
if key in self._config:
# display a warning if we are replacing a value with templates by a value with templates resolved
if "%(" in str(self._config[key][0]) and "%(" not in str(value):
mboisson marked this conversation as resolved.
Show resolved Hide resolved
self.log.warning("Replacing value of templated parameter '%s' with a value with templates"
"resolved. Old value: %s, new value: %s" % (key, self._config[key][0], value))
self._config[key][0] = value
else:
raise EasyBuildError("Use of unknown easyconfig parameter '%s' when setting parameter value to '%s'",
Expand Down