Merge "zuul-web: jobs list endpoint: return 404 when tenant not found"
This commit is contained in:
commit
14df958306
|
@ -379,3 +379,6 @@ class TestBuildInfo(ZuulDBTestCase, BaseTestWeb):
|
||||||
|
|
||||||
builds = self.get_url("api/tenant/tenant-one/builds").json()
|
builds = self.get_url("api/tenant/tenant-one/builds").json()
|
||||||
self.assertEqual(len(builds), 6)
|
self.assertEqual(len(builds), 6)
|
||||||
|
|
||||||
|
resp = self.get_url("api/tenant/non-tenant/builds")
|
||||||
|
self.assertEqual(404, resp.status_code)
|
||||||
|
|
|
@ -314,7 +314,8 @@ class ZuulWebAPI(object):
|
||||||
connection_name = json.loads(job.data[0])
|
connection_name = json.loads(job.data[0])
|
||||||
|
|
||||||
if not connection_name:
|
if not connection_name:
|
||||||
raise Exception("Unable to find connection for tenant %s" % tenant)
|
raise cherrypy.HTTPError(404, 'Tenant %s does not exist.' % tenant)
|
||||||
|
|
||||||
connection = self.zuulweb.connections.connections[connection_name]
|
connection = self.zuulweb.connections.connections[connection_name]
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
|
|
Loading…
Reference in New Issue