From d05469e8bf509af5e79548753bb8910cf849b180 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 29 Sep 2017 09:04:15 -0700 Subject: [PATCH] Update zuul-changes script for v3 We need a tenant name on the enqueue command line. Change-Id: I93a250ab9b7cf904dcffcb58e908ae813e40405e --- tools/zuul-changes.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/zuul-changes.py b/tools/zuul-changes.py index 8b854c79de..d2583546d5 100755 --- a/tools/zuul-changes.py +++ b/tools/zuul-changes.py @@ -20,14 +20,15 @@ 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('tenant', help='The Zuul tenant') +parser.add_argument('pipeline', help='The name of the Zuul pipeline') options = parser.parse_args() data = urllib2.urlopen('%s/status.json' % options.url).read() data = json.loads(data) for pipeline in data['pipelines']: - if pipeline['name'] != options.pipeline_name: + if pipeline['name'] != options.pipeline: continue for queue in pipeline['change_queues']: for head in queue['heads']: @@ -36,9 +37,10 @@ for pipeline in data['pipelines']: continue cid, cps = change['id'].split(',') print( - "zuul enqueue --trigger gerrit --pipeline %s " - "--project %s --change %s,%s" % ( - options.pipeline_name, + "zuul enqueue --tenant %s --trigger gerrit " + "--pipeline %s --project %s --change %s,%s" % ( + options.tenant, + options.pipeline, change['project'], cid, cps) )