summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-03-05 21:20:09 +0000
committerGerrit Code Review <review@openstack.org>2015-03-05 21:20:09 +0000
commitf43858f414e3d2aa214c86c68ffcc1068f999fd6 (patch)
tree585bb47a0a4dbc80524ec2d70b027b0f08f2c040
parentab2857df0ce26a3da846a93d523562c88102f18a (diff)
parent574ec76a6085b13fb1f02697e68baea7cc0bb63b (diff)
downloadzuul-f43858f414e3d2aa214c86c68ffcc1068f999fd6.tar.gz
Merge "Update zuul-changes to use the enqueue command"
-rwxr-xr-xtools/zuul-changes.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/zuul-changes.py b/tools/zuul-changes.py
index 7fc541b1e..9dbf504e7 100755
--- a/tools/zuul-changes.py
+++ b/tools/zuul-changes.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# Copyright 2013 OpenStack Foundation
+# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@@ -13,9 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-# Print commands to leave gerrit comments for every change in one of
-# Zuul's pipelines.
-
import urllib2
import json
import argparse
@@ -23,9 +21,6 @@ import argparse
parser = argparse.ArgumentParser()
parser.add_argument('url', help='The URL of the running Zuul instance')
parser.add_argument('pipeline_name', help='The name of the Zuul pipeline')
-parser.add_argument('comment', help='The text of the Gerrit comment')
-parser.add_argument('--review-host', default='review',
- help='The Gerrit hostname')
options = parser.parse_args()
data = urllib2.urlopen('%s/status.json' % options.url).read()
@@ -37,7 +32,13 @@ for pipeline in data['pipelines']:
for queue in pipeline['change_queues']:
for head in queue['heads']:
for change in head:
- print 'ssh %s gerrit review %s --message \\"%s\\"' % (
- options.review_host,
- change['id'],
- options.comment)
+ if not change['live']:
+ continue
+ cid, cps = change['id'].split(',')
+ print (
+ "zuul enqueue --trigger gerrit --pipeline %s "
+ "--project %s --change %s,%s" % (
+ options.pipeline_name,
+ change['project'],
+ cid, cps)
+ )