zuul-web: jobs list endpoint: Add test and fix tenant not found 500 error
Job lists test was missing so this add a minimal one and also fix the 500 errors return when the tenant does not exist. Change-Id: Ifa161a0c6ac801ced0d55dd48d1d5f83833aeea4
This commit is contained in:
@@ -269,6 +269,8 @@ class ZuulWebAPI(object):
|
||||
def jobs(self, tenant):
|
||||
job = self.rpc.submitJob('zuul:job_list', {'tenant': tenant})
|
||||
ret = json.loads(job.data[0])
|
||||
if ret is None:
|
||||
raise cherrypy.HTTPError(404, 'Tenant %s does not exist.' % tenant)
|
||||
resp = cherrypy.response
|
||||
resp.headers['Access-Control-Allow-Origin'] = '*'
|
||||
return ret
|
||||
|
||||
Reference in New Issue
Block a user