]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/rados: don't try to close watch in dealoc if rados not connected
authorMykola Golub <mgolub@suse.com>
Thu, 12 Mar 2020 09:42:05 +0000 (09:42 +0000)
committerJason Dillaman <dillaman@redhat.com>
Tue, 9 Feb 2021 15:42:04 +0000 (10:42 -0500)
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit eeee5578877b2c96aa46d5ee427ea5c369a42501)

src/pybind/rados/rados.pyx

index 0d0f6aba4df51147967ae7707a5c9bb74f2314bc..648603ae79548f2292c3f2faf9e4a12bc17db8ea 100644 (file)
@@ -2361,6 +2361,7 @@ cdef class Watch(object):
         return False
 
     def __dealloc__(self):
+        self.ioctx.rados.require_state("connected")
         self.close()
 
     def _callback(self, notify_id, notifier_id, watch_id, data):