]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/rbd: normalize errno exception 21165/head
authorsongweibin <song.weibin@zte.com.cn>
Mon, 2 Apr 2018 03:31:04 +0000 (11:31 +0800)
committersongweibin <song.weibin@zte.com.cn>
Mon, 2 Apr 2018 04:38:19 +0000 (12:38 +0800)
The code meant to do so but actually it does not ...

Signed-off-by: songweibin <song.weibin@zte.com.cn>
src/pybind/rbd/rbd.pyx

index 8da4e6514573110cddca73e5237dbc22b3d9952d..3e74f12560d7c05663ded55f8055d69ae704528a 100644 (file)
@@ -538,13 +538,13 @@ class PermissionError(OSError):
 class ImageNotFound(OSError):
     pass
 
-class ObjectNotFound(Error):
+class ObjectNotFound(OSError):
     pass
 
 class ImageExists(OSError):
     pass
 
-class ObjectExists(Error):
+class ObjectExists(OSError):
     pass
 
 
@@ -644,8 +644,8 @@ cdef make_ex(ret, msg, exception_map=errno_to_exception):
     :returns: a subclass of :class:`Error`
     """
     ret = abs(ret)
-    if ret in errno_to_exception:
-        return errno_to_exception[ret](msg, errno=ret)
+    if ret in exception_map:
+        return exception_map[ret](msg, errno=ret)
     else:
         return OSError(msg, errno=ret)
 
@@ -1610,7 +1610,6 @@ cdef class Group(object):
         :type name: str
 
         :raises: :class:`ObjectNotFound`
-        :raises: :class:`ObjectExists`
         :raises: :class:`InvalidArgument`
         :raises: :class:`FunctionNotSupported`
         """
@@ -1660,7 +1659,6 @@ cdef class Group(object):
         :type name: str
 
         :raises: :class:`ObjectNotFound`
-        :raises: :class:`ObjectExists`
         :raises: :class:`InvalidArgument`
         :raises: :class:`FunctionNotSupported`
         """