Commit 8f293467 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Klaus Aehlig

Fix RAPI in case split query mechanism is used

Let RAPI raise HttpNotFound() in case the item requested is not
found, if luxid serves the query (split query mechanism).
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 0a8a0a5f
......@@ -177,13 +177,19 @@ def HandleItemQueryErrors(fn, *args, **kwargs):
"""
try:
return fn(*args, **kwargs)
result = fn(*args, **kwargs)
except errors.OpPrereqError, err:
if len(err.args) == 2 and err.args[1] == errors.ECODE_NOENT:
raise http.HttpNotFound()
raise
# In case split query mechanism is used
if not result:
raise http.HttpNotFound()
return result
def FeedbackFn(msg):
"""Feedback logging function for jobs.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment