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

Unified Diff: scripts/slave/swarming/swarming_utils.py

Issue 22909021: Add build slave side support for the new swarming.py script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: fixes Created 7 years, 4 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
Index: scripts/slave/swarming/swarming_utils.py
diff --git a/scripts/slave/swarming/swarming_utils.py b/scripts/slave/swarming/swarming_utils.py
index b2368da4ed03970985bc63b7b9095d74d932a021..dacc95fb96a415029f61e3f233c587c7f46b0232 100644
--- a/scripts/slave/swarming/swarming_utils.py
+++ b/scripts/slave/swarming/swarming_utils.py
@@ -6,6 +6,12 @@
"""Code to find swarming_client."""
import os
+import sys
+
+from common import find_depot_tools # pylint: disable=W0611
+
+# From depot_tools/
+import subprocess2
def find_client(base_dir):
@@ -24,3 +30,17 @@ def find_client(base_dir):
src_swarm_client = os.path.join(base_dir, 'src', 'tools', 'swarm_client')
if os.path.isdir(src_swarm_client):
return src_swarm_client
+
+
+def get_version(client):
+ """Returns the version of swarming.py client tool, if available."""
+ try:
+ version = subprocess2.check_output(
+ [
+ sys.executable,
+ os.path.join(client, 'swarming.py'),
+ '--version',
+ ])
+ except (subprocess2.CalledProcessError, OSError):
+ return None
+ return map(int, version.split('.'))

Powered by Google App Engine
This is Rietveld 408576698