]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr: improve behavior of ErrorResponse.wrap method
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 19 Aug 2022 15:39:44 +0000 (11:39 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 23 Aug 2022 17:01:45 +0000 (13:01 -0400)
commit61f00ddcb0cce8f3da47ab20faa9d344726e71cd
treee6518b54dd20a7d3c9672c66f9447a64e7ba4e6a
parent370901a4e66f5d5a03c18cfd3808e7026d291385
pybind/mgr: improve behavior of ErrorResponse.wrap method

The wrap classmethod is intended to turn any exception into something
that can produce a manager response. All exceptions inheriting from
ErrorResponseBase can do that, so instead of losing all that state,
have wrap return those exceptions inheriting from ErrorResponseBase
as-is.

Additionally, only change the sign of errno values that aren't already
negative.

Adds tests for these cases.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/object_format.py
src/pybind/mgr/tests/test_object_format.py