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

Unified Diff: gclient.py

Issue 17438005: Prints a hash of the boto file if gclient sync is run from a bot (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: gclient.py
diff --git a/gclient.py b/gclient.py
index 5b159edb0442639b8f656ceb2e25b28e3e1a5e9d..3ddc58dc920fdbb6f96bb8e7dff6038b7d4bbfab 100755
--- a/gclient.py
+++ b/gclient.py
@@ -67,6 +67,7 @@ Specifying a target OS
__version__ = "0.6.4"
import copy
+import hashlib
import logging
import optparse
import os
@@ -1544,6 +1545,21 @@ def CMDsync(parser, args):
(options, args) = parser.parse_args(args)
client = GClient.LoadCurrentConfig(options)
+ # Print some extra info if we are running on a bot.
+ if 'CHROME_HEADLESS' in os.environ and os.environ['CHROME_HEADLESS'] == '1':
+ if 'AWS_CREDENTIAL_FILE' in os.environ:
+ boto_location = os.environ['AWS_CREDENTIAL_FILE']
+ else:
+ boto_location = os.path.expanduser('~/.boto')
+ if os.path.exists(boto_location):
+ with open(boto_location) as f:
+ boto_hash = hashlib.sha1(f.read()).hexdigest()
+ else:
+ boto_hash = 'None'
+ print '===Bot Info==='
+ print 'Boto hash: %s' % boto_hash
+ print '===End Bot Info==='
+
if not client:
raise gclient_utils.Error('client not configured; see \'gclient config\'')
« 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