]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common/tests: update some type annotations
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 1 Nov 2024 17:46:13 +0000 (13:46 -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/python-common/ceph/tests/utils.py

index 04b8a4e38955425441d5b80d2c8dbb6f71b2d6a1..20a39e4666bd931c2ae36290596d273a2640aaf0 100644 (file)
@@ -35,8 +35,7 @@ def _mk_device(rotational=True,
     )]
 
 
-def _mk_inventory(devices):
-    # type: (Any) -> List[Device]
+def _mk_inventory(devices: Any) -> List[Device]:
     devs = []
     for dev_, name in zip(devices, map(chr, range(ord('a'), ord('z')))):
         dev = Device.from_json(dev_.to_json())