mirror of
https://github.com/ceph/ceph
synced 2025-03-05 15:58:41 +00:00
ceph_rest_api.py: return error in nonformatted mode
When a nonformatted request is made, currently the only text in the response is the (probably empty) response buffer. Add the statusmsg as well, where the error is likely to be explained. This lets the http client get a clue what happened. Signed-off-by: Dan Mick <dan.mick@inktank.com>
This commit is contained in:
parent
8b3d7a1b5e
commit
fbf74d987d
@ -322,6 +322,9 @@ def make_response(fmt, output, statusmsg, errorcode):
|
||||
{1}
|
||||
</status>
|
||||
</response>'''.format(response, xml.sax.saxutils.escape(statusmsg))
|
||||
else:
|
||||
if 200 <= errorcode < 300:
|
||||
response = response + '\n' + statusmsg + '\n'
|
||||
|
||||
return flask.make_response(response, errorcode)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user