From 5a510882b8f95579b956ea84134c49323dd299f6 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Wed, 21 Oct 2020 19:02:29 +0300 Subject: [PATCH] Ignore environment SSH_AUTH_SOCK. Only check if git_user/pass are configured, if they are not, leave the links as they are --- trains_agent/helper/repo.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/trains_agent/helper/repo.py b/trains_agent/helper/repo.py index 6dc5156..4928dfc 100644 --- a/trains_agent/helper/repo.py +++ b/trains_agent/helper/repo.py @@ -295,11 +295,9 @@ class VCS(object): if not self.session.config.agent.translate_ssh: return - ssh_agent_variable = "SSH_AUTH_SOCK" - if not getenv(ssh_agent_variable) and ( - (ENV_AGENT_GIT_USER.get() or self.session.config.get('agent.git_user', None)) and - (ENV_AGENT_GIT_PASS.get() or self.session.config.get('agent.git_pass', None)) - ): + # if we have git_user / git_pass replace ssh credentials with https authentication + if (ENV_AGENT_GIT_USER.get() or self.session.config.get('agent.git_user', None)) and \ + (ENV_AGENT_GIT_PASS.get() or self.session.config.get('agent.git_pass', None)): # only apply to a specific domain (if requested) config_domain = \ ENV_AGENT_GIT_HOST.get() or self.session.config.get("git_host", None)