]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: flag an RBD Image as closed regardless of result code 8005/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 9 Mar 2016 18:56:16 +0000 (13:56 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 9 Mar 2016 18:56:16 +0000 (13:56 -0500)
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 <dillaman@redhat.com>
src/pybind/rbd/rbd.pyx

index f25b3e10fce6da29b4f39c305913f0a272db9408..23a9895cfcb8f8dfc1976b31332ec5e9255fe9d9 100644 (file)
@@ -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()