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

Loading…
Cancel
Save