summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTristan Cacqueray <tdecacqu@redhat.com>2018-03-29 09:11:35 +0000
committerTristan Cacqueray <tdecacqu@redhat.com>2018-04-12 03:20:48 +0000
commit559af7048bc8029cf120d09bb2ed0b74577bc28c (patch)
treebdc090ad2053bb6ff566e1b7695ae6a0be95321e /tools
parentc6d9f4c6bfb832f8415ba7d51476b28d6b408f9a (diff)
downloadzuul-559af7048bc8029cf120d09bb2ed0b74577bc28c.tar.gz
zuul-changes: update for the new api url
The Zuul api url changed, this change updates the zuul-changes.py script. Change-Id: Id45f9a8a7e1542bef55097dd89f93a9addc91e1b
Diffstat (limited to 'tools')
-rwxr-xr-xtools/zuul-changes.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/zuul-changes.py b/tools/zuul-changes.py
index cdedf5167..8db576b26 100755
--- a/tools/zuul-changes.py
+++ b/tools/zuul-changes.py
@@ -24,8 +24,20 @@ 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' % options.url).read()
-data = json.loads(data)
+# Check if tenant is white label
+info = json.loads(urllib2.urlopen('%s/api/info' % options.url).read())
+api_tenant = info.get('info', {}).get('tenant')
+if api_tenant:
+ if api_tenant == options.tenant:
+ status_url = '%s/api/status' % options.url
+ else:
+ print("Error: %s doesn't match tenant %s (!= %s)" % (
+ options.url, options.tenant, api_tenant))
+ exit(1)
+else:
+ status_url = '%s/api/tenant/%s/status' % (options.url, options.tenant)
+
+data = json.loads(urllib2.urlopen(status_url).read())
for pipeline in data['pipelines']:
if pipeline['name'] != options.pipeline: