]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: remove old fashioned typing via comments and type ignores
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 4 Oct 2024 18:11:13 +0000 (14:11 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 11 Feb 2025 21:08:04 +0000 (16:08 -0500)
Remove some old-fashioned type-checker comments as we no longer support
any python versions that can't handle type annotations. Remove some
apparently unnecessary type-ignore comments too - mypy had no issues
with the code after removing them.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index de0da4d9021174106c28b8c15d49c0c9a40f0b92..edd84e240caed4bea1b74d63f68d34fc52ddddb4 100755 (executable)
@@ -3412,10 +3412,10 @@ def list_daemons(
         data_dir = os.path.abspath(legacy_dir + data_dir)
 
     # keep track of ceph versions we see
-    seen_versions = {}  # type: Dict[str, Optional[str]]
+    seen_versions: Dict[str, Optional[str]] = {}
 
     # keep track of image digests
-    seen_digests = {}  # type: Dict[str, List[str]]
+    seen_digests: Dict[str, List[str]] = {}
 
     # keep track of memory and cpu usage we've seen
     seen_memusage_cid_len, seen_memusage = parsed_container_mem_usage(ctx)
@@ -3662,7 +3662,7 @@ def list_daemons(
                                     % daemon_type
                                 )
                     else:
-                        vfile = os.path.join(data_dir, fsid, j, 'unit.image')  # type: ignore
+                        vfile = os.path.join(data_dir, fsid, j, 'unit.image')
                         try:
                             with open(vfile, 'r') as f:
                                 image_name = f.read().strip() or None
@@ -3670,7 +3670,7 @@ def list_daemons(
                             pass
 
                     # unit.meta?
-                    mfile = os.path.join(data_dir, fsid, j, 'unit.meta')  # type: ignore
+                    mfile = os.path.join(data_dir, fsid, j, 'unit.meta')
                     try:
                         with open(mfile, 'r') as f:
                             meta = json.loads(f.read())