From ca160372f4b2c3bf2fc1874155e99ce6f925fdd0 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 9 Mar 2016 13:56:16 -0500 Subject: [PATCH] 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 --- src/pybind/rbd/rbd.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- 2.39.5