ninjalog_uploader.py: use cipd to check authenticated account

Googlers authenticate with CIPD now to use reclient.

This is for
https://crrev.com/c/5035266/20#message-6bcb2d14f6758d0ba82d5cff99d699985c934707

Change-Id: Ie78675e6f7a8b47f7cafd85141f87139d1472f1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5058275
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
This commit is contained in:
Takuto Ikuta
2023-11-30 07:15:55 +00:00
committed by LUCI CQ
parent 9e5fc28b6b
commit b5393e57bb
2 changed files with 7 additions and 7 deletions

View File

@@ -51,10 +51,10 @@ ALLOWLISTED_CONFIGS = (
def IsGoogler():
"""Check whether this user is Googler or not."""
p = subprocess.run(
"goma_auth info",
"cipd auth-info",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
text=True,
shell=True,
)
if p.returncode != 0:
@@ -63,8 +63,9 @@ def IsGoogler():
if len(lines) == 0:
return False
l = lines[0]
# |l| will be like 'Login as <user>@google.com' for googler using goma.
return l.startswith("Login as ") and l.endswith("@google.com")
# |l| will be like 'Logged in as <user>@google.com.' for googler using
# reclient.
return l.startswith("Logged in as ") and l.endswith("@google.com.")
def ParseGNArgs(gn_args):