From ca9a5ebcc400ae48c12a1323294689e313426882 Mon Sep 17 00:00:00 2001 From: Edward Lesmes Date: Thu, 13 Feb 2020 19:44:39 +0000 Subject: [PATCH] Revert "gerrit-util: Fix GCE check from behind proxy." This reverts commit 9ee86e5a4697d34a90d096e7f40fb25feca76568. Reason for revert: Typo. Original change's description: > gerrit-util: Fix GCE check from behind proxy. > > Setting HTTP_PROXY or HTTPS_PROXY environment variables will cause git cl > to fail. > > The behavior of an unreachable server behind proxy is different from a direct > connection, it won't throw a httplib2.ServerNotFoundError error, > so catch httplib2.Httplib2Error instead. > > Bug: 1050380 > Change-Id: I32e2220483de1fd6222c7fd6063039fb86277ef0 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2050947 > Reviewed-by: Anthony Polito > Commit-Queue: Edward Lesmes TBR=ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com Change-Id: Idb17520e71fc1d892694e0d4d1cf1630a42bb482 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 1050380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2055390 Reviewed-by: Edward Lesmes Commit-Queue: Edward Lesmes --- gerrit_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gerrit_util.py b/gerrit_util.py index f748bd48b..cf88e7d9b 100644 --- a/gerrit_util.py +++ b/gerrit_util.py @@ -288,7 +288,8 @@ class GceAuthenticator(Authenticator): # Based on https://cloud.google.com/compute/docs/metadata#runninggce try: resp, _ = cls._get(cls._INFO_URL) - except (socket.error, httplib2.Httplib2Error): + except (socket.error, httplib2.ServerNotFoundError, + httplib2.socks.HTTPError): # Could not resolve URL. return False return resp.get('metadata-flavor') == 'Google'