From: Hector Martin Date: Wed, 9 Dec 2015 09:47:40 +0000 (+0900) Subject: pybind/rbd.pyx: misc typo bugfixes X-Git-Tag: v10.0.2~70^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6768%2Fhead;p=ceph.git pybind/rbd.pyx: misc typo bugfixes --- diff --git a/src/pybind/rbd.pyx b/src/pybind/rbd.pyx index df6d6879b76e..931899747f3c 100644 --- a/src/pybind/rbd.pyx +++ b/src/pybind/rbd.pyx @@ -1126,8 +1126,7 @@ cdef class Image(object): :raises: :class:`InvalidArgument`, :class:`IOError`, :class:`ImageNotFound` """ - if from_snapshot is not None and not isinstance(from_snapshot, str): - raise TypeError('client must be a string') + from_snapshot = cstr(from_snapshot, 'from_snapshot', opt=True) cdef: char *_from_snapshot = opt_str(from_snapshot) uint64_t _offset = offset, _length = length @@ -1250,7 +1249,7 @@ written." % (self.name, ret, length)) try: while True: c_pools = realloc_chk(c_pools, pools_size) - c_images = realloc_chk(c_images, pools_size) + c_images = realloc_chk(c_images, images_size) with nogil: ret = rbd_list_children(self.image, c_pools, &pools_size, c_images, &images_size) @@ -1293,7 +1292,7 @@ written." % (self.name, ret, length)) try: while True: c_clients = realloc_chk(c_clients, clients_size) - c_cookies = realloc_chk(c_cookies, clients_size) + c_cookies = realloc_chk(c_cookies, cookies_size) c_addrs = realloc_chk(c_addrs, addrs_size) c_tag = realloc_chk(c_tag, tag_size) with nogil: