Commit 14e6d235 authored by Aravind Vasudevan's avatar Aravind Vasudevan Committed by LUCI CQ

Default fetch to sso:// within cog

This CL makes fetch default to sso:// within the cog env. It also adds a helper within gclient_scm to check if the env is cog.

Bug: chrome-operations:170
Change-Id: I8c35348653406549fadbd08df3d9991bb24ca776
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3670721Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Reviewed-by: 's avatarJoanna Wang <jojwang@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
parent 2a229719
......@@ -260,6 +260,11 @@ def run(options, spec, root):
checkout_type = spec['type']
checkout_spec = spec['%s_spec' % checkout_type]
# Use sso:// by default if the env is cog
if not options.protocol_override and \
os.getcwd().startswith('/google/src/cloud'):
options.protocol_override = 'sso'
# Replace https using the protocol specified in --protocol-override
if options.protocol_override is not None:
for solution in checkout_spec['solutions']:
......
......@@ -208,6 +208,16 @@ class GitWrapper(SCMWrapper):
name = 'git'
remote = 'origin'
_is_env_cog = None
@staticmethod
def _IsCog():
"""Returns true if the env is cog"""
if not GitWrapper._is_env_cog:
GitWrapper._is_env_cog = os.getcwd().startswith('/google/src/cloud')
return GitWrapper._is_env_cog
@property
def cache_dir(self):
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment