[gerrit_util] Skip gitcookies help with newauth enabled

Change-Id: Ie74761efd7bbb50051994a83f21ed150ddf8e4c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5871206
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
This commit is contained in:
Allen Li
2024-09-17 22:41:09 +00:00
committed by LUCI CQ
parent 76021e34e5
commit 74ec765457

View File

@@ -1057,7 +1057,7 @@ def ReadHttpResponse(conn: HttpConn,
www_authenticate = response.get('www-authenticate')
if not www_authenticate:
print('Your Gerrit credentials might be misconfigured.')
else:
elif not newauth.Enabled():
auth_match = re.search('realm="([^"]+)"', www_authenticate, re.I)
host = auth_match.group(1) if auth_match else conn.req_host
new_password_url = CookiesAuthenticator.get_new_password_url(host)