]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: assert JobThread class
authorMichael Fritch <mfritch@suse.com>
Tue, 3 Mar 2020 15:16:11 +0000 (08:16 -0700)
committerMichael Fritch <mfritch@suse.com>
Thu, 5 Mar 2020 20:19:32 +0000 (13:19 -0700)
fixes mypy error:

volumes/fs/async_job.py: note: In member "run" of class "JobThread":
volumes/fs/async_job.py:43: error: "Thread" has no attribute "should_cancel"

Fixes: https://tracker.ceph.com/issues/44393
Signed-off-by: Michael Fritch <mfritch@suse.com>
src/pybind/mgr/volumes/fs/async_job.py

index 7eb8ca2c37fe365331fd6d152b78b25b2bd6363a..4a598372ae2e614df879615cf26e4f35cd51b585 100644 (file)
@@ -25,6 +25,7 @@ class JobThread(threading.Thread):
     def run(self):
         retries = 0
         thread_id = threading.currentThread()
+        assert isinstance(thread_id, JobThread)
         thread_name = thread_id.getName()
 
         while retries < JobThread.MAX_RETRIES_ON_EXCEPTION: