From: Jason Dillaman Date: Wed, 9 Mar 2016 18:56:16 +0000 (-0500) Subject: pybind: flag an RBD Image as closed regardless of result code X-Git-Tag: v10.1.0~183^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ca160372f4b2c3bf2fc1874155e99ce6f925fdd0;p=ceph-ci.git pybind: flag an RBD Image as closed regardless of result code The image will always be closed -- the error code just alerts the user to any possible error encountered when closing the image. Signed-off-by: Jason Dillaman --- diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index f25b3e10fce..23a9895cfcb 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -654,12 +654,12 @@ cdef class Image(object): After this is called, this object should not be used. """ if not self.closed: + self.closed = True with nogil: ret = rbd_close(self.image) if ret < 0: raise make_ex(ret, 'error while closing image %s' % ( self.name,)) - self.closed = True def __dealloc__(self): self.close()