Skip to content
Snippets Groups Projects
Commit 426291e5 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed problem with env config vars.

parent 5efd12d3
Branches
Tags
2 merge requests!283Merge v0.10.0 into master for release,!272Oasis with auth
Pipeline #94727 passed
......@@ -342,7 +342,13 @@ def _apply(key, value, raise_error: bool = True) -> None:
leading to ``config.fs.staging``.
'''
full_key = key
group_key, config_key = full_key.split('_', 1)
try:
group_key, config_key = full_key.split('_', 1)
except Exception:
if raise_error:
logger.error(f'config key does not exist: {full_key}')
return
current = globals()
if group_key not in current:
......
......@@ -51,6 +51,9 @@ def test_apply(with_config, caplog):
config._apply('max_entry_download', 'not_a_number')
assert_log(caplog, 'ERROR', 'cannot set')
config._apply('nounderscore', 'test_value')
assert_log(caplog, 'ERROR', 'nounderscore does not exist')
def test_env(with_config, monkeypatch):
monkeypatch.setattr('os.environ', dict(NOMAD_FS_PUBLIC='test_value'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment