From 574ec76a6085b13fb1f02697e68baea7cc0bb63b Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 27 Feb 2015 13:50:31 -0800 Subject: Update zuul-changes to use the enqueue command Change-Id: I990cd0282f8e6d7706dc1bb6b6573b929623a171 --- tools/zuul-changes.py | 21 +++++++++++---------- 1 file 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) + ) -- cgit v1.2.1