]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: `threading.Event.isSet` no longer exists in py3
authorMichael Fritch <mfritch@suse.com>
Tue, 3 Mar 2020 15:18:11 +0000 (08:18 -0700)
committerRamana Raja <rraja@redhat.com>
Thu, 19 Mar 2020 12:57:32 +0000 (18:27 +0530)
fixes mypy errors:

volumes/fs/async_job.py: note: In member "should_cancel" of class "JobThread":
volumes/fs/async_job.py:70: error: "Event" has no attribute "isSet"

volumes/fs/volume.py: note: In member "is_stopping" of class "VolumeClient":
volumes/fs/volume.py:59: error: "Event" has no attribute "isSet"

volumes/fs/volume.py: note: In member "list_fs_volumes" of class "VolumeClient":
volumes/fs/volume.py:106: error: "Event" has no attribute "isSet"

Fixes: https://tracker.ceph.com/issues/44393
Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit aaed49a142722089f8a24ceb8b846b7c1c51d5f6)

src/pybind/mgr/volumes/fs/async_job.py
src/pybind/mgr/volumes/fs/volume.py

index 4a598372ae2e614df879615cf26e4f35cd51b585..a83fc6dc91698a757b4c1665eb3a47f1bcac9fdb 100644 (file)
@@ -67,7 +67,7 @@ class JobThread(threading.Thread):
         self.cancel_event.set()
 
     def should_cancel(self):
-        return self.cancel_event.isSet()
+        return self.cancel_event.is_set()
 
     def reset_cancel(self):
         self.cancel_event.clear()
index a10488d12923da3f82e770c9daf8bd677f19380c..b3be1b8c97fdfc114dd6b237951eb9a9cb933066 100644 (file)
@@ -56,7 +56,7 @@ class VolumeClient(object):
             self.purge_queue.queue_job(fs['mdsmap']['fs_name'])
 
     def is_stopping(self):
-        return self.stopping.isSet()
+        return self.stopping.is_set()
 
     def shutdown(self):
         log.info("shutting down")
@@ -103,7 +103,7 @@ class VolumeClient(object):
         return delete_volume(self.mgr, volname)
 
     def list_fs_volumes(self):
-        if self.stopping.isSet():
+        if self.stopping.is_set():
             return -errno.ESHUTDOWN, "", "shutdown in progress"
         volumes = list_volumes(self.mgr)
         return 0, json.dumps(volumes, indent=4, sort_keys=True), ""