From 68fe29eb78e8936487cb0075e6e8d399c5f0b3cf Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Fri, 4 Oct 2024 14:11:13 -0400 Subject: [PATCH] cephadm: remove old fashioned typing via comments and type ignores 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 --- src/cephadm/cephadm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index de0da4d9021..edd84e240ca 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -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()) -- 2.47.3