mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[gerrit_util] Add fallback if missing Gerrit account
Bug: b/366261039 Change-Id: I7d22c4f03ad9bd837190dee7a511af3437a30434 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5869050 Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Commit-Queue: Allen Li <ayatane@chromium.org>
This commit is contained in:
@@ -36,7 +36,7 @@ class ConfigChanger(object):
|
||||
#
|
||||
# Increment this when making changes to the config, so that reliant
|
||||
# code can determine whether the config needs to be re-applied.
|
||||
VERSION: int = 2
|
||||
VERSION: int = 3
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -130,6 +130,9 @@ class ConfigChanger(object):
|
||||
email: str = scm.GIT.GetConfig(cwd, 'user.email') or ''
|
||||
if gerrit_util.ShouldUseSSO(gerrit_host, email):
|
||||
return ConfigMode.NEW_AUTH_SSO
|
||||
if not gerrit_util.LuciAuthAuthenticator.gerrit_account_exists(
|
||||
gerrit_host):
|
||||
return ConfigMode.NO_AUTH
|
||||
return ConfigMode.NEW_AUTH
|
||||
|
||||
def apply(self, cwd: str) -> None:
|
||||
|
||||
Reference in New Issue
Block a user