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

Unified Diff: slave/run_slave.py

Issue 18457003: Use corrected env for first sync too. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build/
Patch Set: Created 7 years, 5 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: slave/run_slave.py
===================================================================
--- slave/run_slave.py (revision 210203)
+++ slave/run_slave.py (working copy)
@@ -281,6 +281,16 @@
sys.exit(1)
+def UseBotoPath():
+ """Mutate the environment to reference the prefered gs credentials."""
+ # Get the path to the boto file containing the password.
+ boto_file = os.path.join(BUILD_DIR, 'site_config', '.boto')
+ # If the boto file exists, make sure gsutil uses this boto file.
+ if os.path.exists(boto_file):
+ os.environ['AWS_CREDENTIAL_FILE'] = boto_file
+ os.environ['BOTO_CONFIG'] = boto_file
+
+
def main():
# Use adhoc argument parsing because of twisted's twisted argument parsing.
# Change the current directory to the directory of the script.
@@ -439,12 +449,8 @@
else:
error('Platform %s is not implemented yet' % sys.platform)
- # Get the path to the boto file containing the password.
- boto_file = os.path.join(BUILD_DIR, 'site_config', '.boto')
- # If the boto file exists, make sure gsutil uses this boto file.
- if os.path.exists(boto_file):
- os.environ['AWS_CREDENTIAL_FILE'] = boto_file
- os.environ['BOTO_CONFIG'] = boto_file
+ # This may be redundant, unless this is imported and main is called.
+ UseBotoPath()
# This envrionment is defined only when testing the slave on a dev machine.
is_testing = 'TESTING_MASTER' in os.environ
@@ -472,6 +478,7 @@
if '__main__' == __name__:
skip_sync_arg = '--no-gclient-sync'
if skip_sync_arg not in sys.argv:
+ UseBotoPath()
Isaac (away) 2013/07/04 20:56:15 Move this one line up and I think you can skip the
if subprocess.call([GetGClientPath(), 'sync', '--force']) != 0:
print >> sys.stderr, (
'(%s) `gclient sync` failed; proceeding anyway...' % sys.argv[0])
« 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