Commit 40cdc99c authored by hinoka@chromium.org's avatar hinoka@chromium.org

Simply download_from_google_storage --config

This does two noticable things:
* Prints a message when "download_from_google_storage --config" is run to
  tell the user to enter "0" for the project ID prompt
* Removes the ".boto.depot_tools" boto file and defaults the boto file to
  grant fullcontrol scopes.

Context: We restricted the depot_tools specific scopes to be readonly out of
concern that we would be forcing every developer to hold a set of non-expiring
write access credentials on their workstation.  But this distinction has caused
a great deal of pain and anguish with confusing credentials (who would've thought
~/.boto.depot_tools would exist and might be broken?), and not for huge security
gains.  Most people don't have write access to buckets, and the ones that do
definitely has a fullcontrol boto file already.

BUG=

Review URL: https://codereview.chromium.org/1182583003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295728 0039d316-1c4b-4281-b951-d872f2087c98
parent 294c783e
......@@ -54,7 +54,7 @@ def GetNormalizedPlatform():
class Gsutil(object):
"""Call gsutil with some predefined settings. This is a convenience object,
and is also immutable."""
def __init__(self, path, boto_path, timeout=None, version='4.7'):
def __init__(self, path, boto_path=None, timeout=None, version='4.7'):
if not os.path.exists(path):
raise FileNotFoundError('GSUtil not found in %s' % path)
self.path = path
......@@ -70,11 +70,6 @@ class Gsutil(object):
elif self.boto_path:
env['AWS_CREDENTIAL_FILE'] = self.boto_path
env['BOTO_CONFIG'] = self.boto_path
else:
custompath = env.get('AWS_CREDENTIAL_FILE', '~/.boto') + '.depot_tools'
custompath = os.path.expanduser(custompath)
if os.path.exists(custompath):
env['AWS_CREDENTIAL_FILE'] = custompath
return env
......@@ -403,8 +398,11 @@ def main(args):
# Passing in -g/--config will run our copy of GSUtil, then quit.
if options.config:
return gsutil.call('config', '-r', '-o',
os.path.expanduser('~/.boto.depot_tools'))
print '===Note from depot_tools==='
print 'If you do not have a project ID, enter "0" when asked for one.'
print '===End note from depot_tools==='
print
return gsutil.call('config')
if not args:
parser.error('Missing target.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment