mirror of
https://github.com/clearml/clearml
synced 2025-06-04 03:47:57 +00:00
Log env vars starting with * in environ_bind.py (#459)
This commit is contained in:
parent
dd3d4cec94
commit
4955c7a784
@ -41,14 +41,17 @@ class EnvironmentBind(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
env_param = dict()
|
env_param = dict()
|
||||||
for match in (environ_log or []):
|
for match in environ_log:
|
||||||
match = match.strip()
|
match = match.strip()
|
||||||
if match == '*':
|
if match == '*':
|
||||||
env_param.update({k: os.environ.get(k) for k in os.environ
|
env_param.update({k: os.environ.get(k) for k in os.environ
|
||||||
if not k.startswith('TRAINS_') and not k.startswith('CLEARML_')})
|
if not k.startswith('TRAINS_') and not k.startswith('CLEARML_')})
|
||||||
elif match.endswith('*'):
|
elif match.endswith('*'):
|
||||||
match = match.strip('*')
|
match = match.rstrip('*')
|
||||||
env_param.update({k: os.environ.get(k) for k in os.environ if k.startswith(match)})
|
env_param.update({k: os.environ.get(k) for k in os.environ if k.startswith(match)})
|
||||||
|
elif match.startswith('*'):
|
||||||
|
match = match.lstrip('*')
|
||||||
|
env_param.update({k: os.environ.get(k) for k in os.environ if k.endswith(match)})
|
||||||
elif match in os.environ:
|
elif match in os.environ:
|
||||||
env_param.update({match: os.environ.get(match)})
|
env_param.update({match: os.environ.get(match)})
|
||||||
# store os environments
|
# store os environments
|
||||||
|
Loading…
Reference in New Issue
Block a user