]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: skip type checking on RTimer class
authorMichael Fritch <mfritch@suse.com>
Tue, 3 Mar 2020 15:21:18 +0000 (08:21 -0700)
committerMichael Fritch <mfritch@suse.com>
Thu, 5 Mar 2020 20:19:33 +0000 (13:19 -0700)
Unclear why mypy does not like this:

volumes/fs/operations/volume.py: note: In member "run" of class "RTimer":
volumes/fs/operations/volume.py:118: error: "RTimer" has no attribute "finished"
volumes/fs/operations/volume.py:119: error: "RTimer" has no attribute "finished"
volumes/fs/operations/volume.py:119: error: "RTimer" has no attribute "interval"
volumes/fs/operations/volume.py:120: error: "RTimer" has no attribute "function"
volumes/fs/operations/volume.py:120: error: "RTimer" has no attribute "args"
volumes/fs/operations/volume.py:120: error: "RTimer" has no attribute "kwargs"
volumes/fs/operations/volume.py:121: error: "RTimer" has no attribute "finished"

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

index 03b1face0c6759171254b42090a0417181516f35..417404532eeada92c18c57131660b388257b6598 100644 (file)
@@ -5,6 +5,7 @@ import sys
 
 from contextlib import contextmanager
 from threading import Lock, Condition
+from typing import no_type_check
 
 if sys.version_info >= (3, 3):
     from threading import Timer
@@ -109,6 +110,7 @@ class ConnectionPool(object):
         """
         recurring timer variant of Timer
         """
+        @no_type_check
         def run(self):
             try:
                 while not self.finished.is_set():