[auth-unify] deprecate no_auth options in download_for_google_storage

This will reduce confusion with the tools, gsutil.py will now take into
account supplied boto config outside of authentication (such as proxy
settings).

If the user is not logged in with luci-auth, the users configured .boto
config (including auth if configured) will still be taken into account
by the regular gsutil (not gsutil.py!) command.

Bug:b/342261857
Change-Id: I369489db60c46c13cbe9fd93d15c9597a525feb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6414748
Commit-Queue: Dan Le Febvre <dlf@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
changes/48/6414748/3
Dan Le Febvre 3 weeks ago committed by LUCI CQ
parent 41b8b54089
commit cb5069bb8e

@ -625,8 +625,7 @@ def main(args):
parser.add_option('-n',
'--no_auth',
action='store_true',
help='Skip auth checking. Use if it\'s known that the '
'target bucket is a public bucket.')
help='DEPRECATED: This flag has no effect.')
parser.add_option('-p',
'--platform',
help='A regular expression that is compared against '
@ -671,26 +670,15 @@ def main(args):
options.platform)
return 0
# Set the boto file to /dev/null if we don't need auth.
if options.no_auth:
if (set(
('http_proxy', 'https_proxy')).intersection(env.lower()
for env in os.environ)
and 'NO_AUTH_BOTO_CONFIG' not in os.environ):
print(
'NOTICE: You have PROXY values set in your environment, but '
'gsutil in depot_tools does not (yet) obey them.',
file=sys.stderr)
print(
'Also, --no_auth prevents the normal BOTO_CONFIG environment '
'variable from being used.',
file=sys.stderr)
print(
'To use a proxy in this situation, please supply those '
'settings in a .boto file pointed to by the '
'NO_AUTH_BOTO_CONFIG environment variable.',
file=sys.stderr)
options.boto = os.environ.get('NO_AUTH_BOTO_CONFIG', os.devnull)
print('--no_auth is deprecated, this flag has no effect.')
if 'NO_AUTH_BOTO_CONFIG' in os.environ:
print(
'The NO_AUTH_BOTO_CONFIG environment variable is deprecated and ',
'has no effect. gsutil.py will always use any [GSUtil] or [Boto] ',
'settings in the .boto configuration file, regardless of ',
'whether you\'re logged in with luci-auth.')
# Make sure gsutil exists where we expect it to.
if os.path.exists(GSUTIL_DEFAULT_PATH):

Loading…
Cancel
Save