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

Unified Diff: download_from_google_storage.py

Issue 17351008: Add an alternate default boto file for bootstrapping source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 7 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
===================================================================
--- download_from_google_storage.py (revision 207434)
+++ download_from_google_storage.py (working copy)
@@ -42,23 +42,29 @@
self.timeout = timeout
self.boto_path = boto_path
- def call(self, *args):
+ def get_sub_env(self):
env = os.environ.copy()
if self.boto_path:
env['AWS_CREDENTIAL_FILE'] = 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):
return subprocess2.call((sys.executable, self.path) + args,
- env=env,
+ env=self.get_sub_env(),
timeout=self.timeout)
def check_call(self, *args):
- env = os.environ.copy()
- if self.boto_path:
- env['AWS_CREDENTIAL_FILE'] = self.boto_path
((out, err), code) = subprocess2.communicate(
(sys.executable, self.path) + args,
stdout=subprocess2.PIPE,
stderr=subprocess2.PIPE,
- env=env,
+ env=self.get_sub_env(),
timeout=self.timeout)
# Parse output.
« 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