Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: download_from_google_storage.py

Issue 1182583003: Simply download_from_google_storage --config (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: download_from_google_storage.py
diff --git a/download_from_google_storage.py b/download_from_google_storage.py
index 291643b1ee429099a1a27dd60731fb1f0c9a1914..fef29465385fe9d7b64cf9be49b7d6d7ba3f5d0f 100755
--- a/download_from_google_storage.py
+++ b/download_from_google_storage.py
@@ -64,24 +64,19 @@ class Gsutil(object):
def get_sub_env(self):
env = os.environ.copy()
- if self.boto_path == os.devnull:
- env['AWS_CREDENTIAL_FILE'] = ''
- env['BOTO_CONFIG'] = ''
- elif self.boto_path:
+ if 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
def call(self, *args):
cmd = [sys.executable, self.path, '--force-version', self.version]
cmd.extend(args)
- return subprocess2.call(cmd, env=self.get_sub_env(), timeout=self.timeout)
+ if sys.platform.startswith('win'):
+ return subprocess2.call(cmd, env=self.get_sub_env(), timeout=self.timeout)
+ else:
+ os.execv(sys.executable, cmd)
Vadim Sh. 2015/06/17 19:24:04 why? Are you sure 'call' is not used multiple time
hinoka 2015/06/17 19:49:20 I thought it would've been cleaner, but on second
def check_call(self, *args):
cmd = [sys.executable, self.path, '--force-version', self.version]
@@ -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.')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698