zuul-web: key endpoint: return 404 when tenant or project not found
Fix the endpoint to remove 500 error when tenant or project is not found. Change-Id: I5fec37635cca8a697dba1c749d75c78bae24411c
This commit is contained in:
@@ -289,6 +289,9 @@ class ZuulWebAPI(object):
|
||||
def key(self, tenant, project):
|
||||
job = self.rpc.submitJob('zuul:key_get', {'tenant': tenant,
|
||||
'project': project})
|
||||
if not job.data:
|
||||
raise cherrypy.HTTPError(
|
||||
404, 'Project %s does not exist.' % project)
|
||||
resp = cherrypy.response
|
||||
resp.headers['Access-Control-Allow-Origin'] = '*'
|
||||
resp.headers['Content-Type'] = 'text/plain'
|
||||
|
||||
Reference in New Issue
Block a user