]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common/deployment: update some type annotations
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 1 Nov 2024 17:43:01 +0000 (13:43 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 4 Nov 2024 20:38:43 +0000 (15:38 -0500)
flake8 flagged unused imports in this file due to the use of old style
type comments. This file was easy to convert to new style annotations so
that was done.

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/deployment/drive_selection/filter.py

index 0da1b5c3901fa13aa7c25ef4d369a2027ad051aa..28f63ddc2f215c85fb204b3f728e2193e002336e 100644 (file)
@@ -15,12 +15,10 @@ logger = logging.getLogger(__name__)
 
 
 class FilterGenerator(object):
-    def __init__(self, device_filter):
-        # type: (DeviceSelection) -> None
+    def __init__(self, device_filter: DeviceSelection) -> None:
         self.device_filter = device_filter
 
-    def __iter__(self):
-        # type: () -> Generator[Matcher, None, None]
+    def __iter__(self) -> Generator[Matcher, None, None]:
         if self.device_filter.actuators:
             yield EqualityMatcher('actuators', self.device_filter.actuators)
         if self.device_filter.size: