Index: rietveld.py |
diff --git a/rietveld.py b/rietveld.py |
index 9dfe8892b610dfca7c1707c47605e1f841da15e8..ed7ac2b8f95f06e6f1694a74bee07aa93e80b669 100644 |
--- a/rietveld.py |
+++ b/rietveld.py |
@@ -332,7 +332,7 @@ class Rietveld(object): |
def trigger_try_jobs( |
self, issue, patchset, reason, clobber, revision, builders_and_tests): |
ghost stip (do not use)
2014/03/01 00:56:16
add optional master= argument, and have trigger_di
|
- """Requests new try jobs. |
+ """Requests new try jobs. Deprecated in favor of the method below. |
|builders_and_tests| is a map of builders: [tests] to run. |
@@ -348,6 +348,28 @@ class Rietveld(object): |
params.append(('revision', revision)) |
return self.post('/%d/try/%d' % (issue, patchset), params) |
+ def trigger_distributed_try_jobs( |
+ self, issue, patchset, reason, clobber, revision, masters): |
+ """Requests new try jobs. |
+ |
+ |masters| is a map of masters: map of builders: [tests] to run. |
+ """ |
+ for (master, builders_and_tests) in masters.iteritems(): |
+ params = [ |
+ ('reason', reason), |
+ ('clobber', 'True' if clobber else 'False'), |
+ ('builders', json.dumps(builders_and_tests)), |
+ ('xsrf_token', self.xsrf_token()), |
+ ] |
+ if revision: |
+ params.append(('revision', revision)) |
+ if master: |
+ # Temporarily allow empty master names for old configurations. The try |
+ # job will not be associated with a master name on rietveld. This is |
+ # going to be deprecated. |
+ params.append(('master', master)) |
+ self.post('/%d/try/%d' % (issue, patchset), params) |
+ |
def get_pending_try_jobs(self, cursor=None, limit=100): |
"""Retrieves the try job requests in pending state. |
@@ -542,3 +564,8 @@ class ReadOnlyRietveld(object): |
self, issue, patchset, reason, clobber, revision, builders_and_tests): |
logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
(builders_and_tests, issue)) |
+ |
+ def trigger_distributed_try_jobs( # pylint:disable=R0201 |
+ self, issue, patchset, reason, clobber, revision, masters): |
+ logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
+ (masters, issue)) |