From: Dan Mick Date: Fri, 26 Jul 2013 02:40:26 +0000 (-0700) Subject: ceph_rest_api.py: return error in nonformatted mode X-Git-Tag: v0.67-rc3~51 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fbf74d987d22dcca832a8afd358e0d76d4442f4c;p=ceph.git 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 --- diff --git a/src/pybind/ceph_rest_api.py b/src/pybind/ceph_rest_api.py index 6165d31f9b9..f69f1809d61 100755 --- a/src/pybind/ceph_rest_api.py +++ b/src/pybind/ceph_rest_api.py @@ -322,6 +322,9 @@ def make_response(fmt, output, statusmsg, errorcode): {1} '''.format(response, xml.sax.saxutils.escape(statusmsg)) + else: + if 200 <= errorcode < 300: + response = response + '\n' + statusmsg + '\n' return flask.make_response(response, errorcode)