Merge pull request #21165 from Songweibin/wip-drop-redefine-func

librbd: minor code cleanup

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2018-04-02 11:17:04 -04:00 committed by GitHub
commit 5585e52c47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 11 deletions

View File

@ -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,

View File

@ -398,6 +398,10 @@ int Group<I>::remove(librados::IoCtx& io_ctx, const char *group_name)
std::vector<cls::rbd::GroupSnapshot> 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);

View File

@ -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`
"""