mirror of
https://github.com/clearml/clearml-agent
synced 2025-01-31 09:06:52 +00:00
Fix agent.git_host
setting will cause git@domain URLs to not be replaced by SSH URLs since furl cannot parse them to obtain host
This commit is contained in:
parent
7c3e420df4
commit
3dd8d783e1
@ -346,10 +346,17 @@ class VCS(object):
|
|||||||
# if we have git_user / git_pass replace ssh credentials with https authentication
|
# 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 \
|
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)):
|
(ENV_AGENT_GIT_PASS.get() or self.session.config.get('agent.git_pass', None)):
|
||||||
|
|
||||||
# only apply to a specific domain (if requested)
|
# only apply to a specific domain (if requested)
|
||||||
config_domain = \
|
config_domain = \
|
||||||
ENV_AGENT_GIT_HOST.get() or self.session.config.get("agent.git_host", None)
|
ENV_AGENT_GIT_HOST.get() or self.session.config.get("agent.git_host", None)
|
||||||
if config_domain and config_domain != furl(self.url).host:
|
if config_domain:
|
||||||
|
if config_domain != furl(self.url).host:
|
||||||
|
# bail out here if we have a git_host configured and it's different than the URL host
|
||||||
|
# however, we should make sure this is not an ssh@ URL that furl failed to parse
|
||||||
|
ssh_git_url_match = self.SSH_URL_GIT_SYNTAX.match(self.url)
|
||||||
|
if not ssh_git_url_match or config_domain != ssh_git_url_match.groupdict().get("host"):
|
||||||
|
# do not replace to ssh url
|
||||||
return
|
return
|
||||||
|
|
||||||
new_url = self.replace_ssh_url(self.url)
|
new_url = self.replace_ssh_url(self.url)
|
||||||
|
Loading…
Reference in New Issue
Block a user