From 3a7f62489a62e4af259b11b8ed95e5d18aa79ef2 Mon Sep 17 00:00:00 2001 From: Takuto Ikuta Date: Tue, 23 Jan 2024 09:19:34 +0000 Subject: [PATCH] autoninja: make it possible to skip external account check This is for some internal infrastructures which want to use service accounts from corp machines. Bug: b/320639792 Change-Id: Ie90241fe89e0bb0fb5526844e2e3651cc316d945 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5226384 Reviewed-by: Fumitoshi Ukai Commit-Queue: Takuto Ikuta Reviewed-by: Richard Wang Auto-Submit: Takuto Ikuta --- autoninja.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autoninja.py b/autoninja.py index 0fc54da898..9e57335604 100755 --- a/autoninja.py +++ b/autoninja.py @@ -102,6 +102,14 @@ def _is_google_corp_machine(): def _is_google_corp_machine_using_external_account(): + if os.environ.get("AUTONINJA_SKIP_EXTERNAL_ACCOUNT_CHECK") == "1": + print( + "WARNING: AUTONINJA_SKIP_EXTERNAL_ACCOUNT_CHECK env var is set.\n" + "This is only for some infra, do not set this in personal" + " development machine.", + file=sys.stderr) + return False + if not _is_google_corp_machine(): return False