diff --git a/src/include/rbd/librbd.h b/src/include/rbd/librbd.h index f76a611986f..51d83f9066d 100644 --- a/src/include/rbd/librbd.h +++ b/src/include/rbd/librbd.h @@ -547,11 +547,8 @@ CEPH_RBD_API int rbd_snap_set(rbd_image_t image, const char *snapname); CEPH_RBD_API int rbd_snap_set_by_id(rbd_image_t image, uint64_t snap_id); CEPH_RBD_API int rbd_snap_get_namespace_type(rbd_image_t image, - uint64_t snap_id, - rbd_snap_namespace_type_t *namespace_type); -CEPH_RBD_API int rbd_snap_get_namespace_type(rbd_image_t image, - uint64_t snap_id, - rbd_snap_namespace_type_t *namespace_type); + uint64_t snap_id, + rbd_snap_namespace_type_t *namespace_type); CEPH_RBD_API int rbd_snap_get_group_namespace(rbd_image_t image, uint64_t snap_id, rbd_snap_group_namespace_t *group_snap, diff --git a/src/librbd/api/Group.cc b/src/librbd/api/Group.cc index 8a6ae934c40..8bd27aa7cc0 100644 --- a/src/librbd/api/Group.cc +++ b/src/librbd/api/Group.cc @@ -398,6 +398,10 @@ int Group::remove(librados::IoCtx& io_ctx, const char *group_name) std::vector snaps; r = group_snap_list(io_ctx, group_name, &snaps); + if (r < 0 && r != -ENOENT) { + lderr(cct) << "error listing group snapshots" << dendl; + return r; + } for (auto &snap : snaps) { r = group_snap_remove_by_record(io_ctx, snap, group_id, group_header_oid); diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index 7d6c8529f82..d0fe89dc3e1 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -545,13 +545,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 @@ -651,8 +651,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) @@ -1643,7 +1643,6 @@ cdef class Group(object): :type name: str :raises: :class:`ObjectNotFound` - :raises: :class:`ObjectExists` :raises: :class:`InvalidArgument` :raises: :class:`FunctionNotSupported` """ @@ -1693,7 +1692,6 @@ cdef class Group(object): :type name: str :raises: :class:`ObjectNotFound` - :raises: :class:`ObjectExists` :raises: :class:`InvalidArgument` :raises: :class:`FunctionNotSupported` """