]> 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)
committerJuan Miguel Olmo Martínez <jolmomar@redhat.com>
Mon, 25 Jan 2021 17:51:16 +0000 (18:51 +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>
(cherry picked from commit 4fa175e96783f698f5b1e78515fef0016e4e026e)

src/cephadm/cephadm

index 0fbfab0539b0e987117b2ab10ef644f8b0634be6..b9a401c5ca8b7b67fbef019535904329b0b9c5c1 100755 (executable)
@@ -1025,7 +1025,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