mirror of
https://github.com/clearml/clearml-session
synced 2025-03-13 23:28:10 +00:00
Fix interactive session on virtual environment agent changing .bashrc/.profile
This commit is contained in:
parent
a4581572c1
commit
7e2c43581a
@ -498,6 +498,13 @@ def setup_ssh_server(hostname, hostnames, param, task):
|
||||
|
||||
def setup_user_env(param, task):
|
||||
env = setup_os_env(param)
|
||||
# do not change user bash/profile
|
||||
if os.geteuid() != 0:
|
||||
if param.get("user_key") and param.get("user_secret"):
|
||||
env['TRAINS_API_ACCESS_KEY'] = param.get("user_key")
|
||||
env['TRAINS_API_SECRET_KEY'] = param.get("user_secret")
|
||||
return env
|
||||
|
||||
# create symbolic link to the venv
|
||||
environment = os.path.expanduser('~/environment')
|
||||
# noinspection PyBroadException
|
||||
|
Loading…
Reference in New Issue
Block a user