]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: annotate variable type for mypy
authorJoao Eduardo Luis <joao@suse.com>
Sat, 16 Jan 2021 15:33:43 +0000 (14:33 -0100)
committerJoao Eduardo Luis <joao@suse.com>
Wed, 20 Jan 2021 14:20:47 +0000 (13:20 -0100)
mypy was complaining about the type of the variable being None, later on
on assignment with an int.

Signed-off-by: Joao Eduardo Luis <joao@suse.com>
src/cephadm/cephadm

index c4a43883c9ba60b907005c49b18defb1729ba596..1712af59e045bfc78c3c1a4a099be21305e881ea 100755 (executable)
@@ -1026,7 +1026,7 @@ class FileLock(object):
         # os.open() function.
         # This file lock is only NOT None, if the object currently holds the
         # lock.
-        self._lock_file_fd = None
+        self._lock_file_fd: Optional[int] = None
         self.timeout = timeout
         # The lock counter is used for implementing the nested locking
         # mechanism. Whenever the lock is acquired, the counter is increased and