From 0ebd029d8c60780323a1c5c14f79e88e6c7786e0 Mon Sep 17 00:00:00 2001 From: "mmoss@chromium.org" Date: Thu, 15 Jan 2015 19:00:49 +0000 Subject: [PATCH] Support optional BOTO specification with --no_auth. This prevents --no_auth from always clearing BOTO_CONFIG, since there are times when a BOTO is needed for other things than just auth info (e.g. proxy settings). BUG=443523 R=hinoka@chromium.org, szager@chromium.org Review URL: https://codereview.chromium.org/844373002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293652 0039d316-1c4b-4281-b951-d872f2087c98 --- download_from_google_storage.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/download_from_google_storage.py b/download_from_google_storage.py index 09be339d4..0f53ea46e 100755 --- a/download_from_google_storage.py +++ b/download_from_google_storage.py @@ -384,7 +384,18 @@ def main(args): # Set the boto file to /dev/null if we don't need auth. if options.no_auth: - options.boto = os.devnull + if (set(('http_proxy', 'https_proxy')).intersection( + env.lower() for env in os.environ) and + 'NO_AUTH_BOTO_CONFIG' not in os.environ): + print >> sys.stderr, ('NOTICE: You have PROXY values set in your ' + 'environment, but gsutil in depot_tools does not ' + '(yet) obey them.') + print >> sys.stderr, ('Also, --no_auth prevents the normal BOTO_CONFIG ' + 'environment variable from being used.') + print >> sys.stderr, ('To use a proxy in this situation, please supply ' + 'those settings in a .boto file pointed to by ' + 'the NO_AUTH_BOTO_CONFIG environment var.') + options.boto = os.environ.get('NO_AUTH_BOTO_CONFIG', os.devnull) # Make sure gsutil exists where we expect it to. if os.path.exists(GSUTIL_DEFAULT_PATH):