]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: update some type annotations
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 1 Nov 2024 18:36:43 +0000 (14:36 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 4 Nov 2024 20:38:43 +0000 (15:38 -0500)
Update some function typing from the old comment based style to the current
type annotations style. Not only does this modernize the code but it fixes
issues found by newer versions of flake8 that were flagging types only
referenced in type comments as unused imports.

Part of an effort to get ceph tox environments passing on Python 3.12.

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

index 0ab8b38d2b518279158587010071d6ade2e8dc80..9caef3f72e5fcea1014c66b775c53df50fdf6b85 100644 (file)
@@ -189,8 +189,9 @@ def normalize_image_digest(digest: str) -> str:
     return digest
 
 
-def get_legacy_config_fsid(cluster, legacy_dir=None):
-    # type: (str, Optional[str]) -> Optional[str]
+def get_legacy_config_fsid(
+    cluster: str, legacy_dir: Optional[str] = None
+) -> Optional[str]:
     config_file = '/etc/ceph/%s.conf' % cluster
     if legacy_dir is not None:
         config_file = os.path.abspath(legacy_dir + config_file)