]> git-server-git.apps.pok.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)
committerRamana Raja <rraja@redhat.com>
Thu, 19 Mar 2020 12:57:32 +0000 (18:27 +0530)
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>
(cherry picked from commit 6907c440e1350e4088c0562bffcc08439633298f)

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: