summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@hp.com>2015-02-27 13:50:31 -0800
committerJoshua Hesketh <josh@nitrotech.org>2015-03-03 15:46:04 +1100
commit574ec76a6085b13fb1f02697e68baea7cc0bb63b (patch)
tree988ec8cbed7ff4606cfcce544d05fbd044c8a416
parentdb8b89bef7160a40489bd193888adbab319718c3 (diff)
downloadzuul-574ec76a6085b13fb1f02697e68baea7cc0bb63b.tar.gz
Update zuul-changes to use the enqueue command
Change-Id: I990cd0282f8e6d7706dc1bb6b6573b929623a171
-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)
+ )