]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: make annotations for schedule.py mandatory
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 20 Nov 2020 11:06:59 +0000 (12:06 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 7 Jan 2021 12:02:21 +0000 (13:02 +0100)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit ba3189b13882ff919ad39a2e377fa6b29c04c79a)

 Conflicts:
src/mypy.ini

src/mypy.ini
src/pybind/mgr/cephadm/schedule.py

index 94f852f5e51541b03d3f3439688afc7bb03c62a1..a736839c88e7608c680489a976553ee201f62c82 100755 (executable)
@@ -18,3 +18,6 @@ disallow_untyped_defs = True
 [mypy-cephadm.inventory]
 disallow_untyped_defs = True
 
+[mypy-cephadm.schedule]
+disallow_untyped_defs = True
+
index 26bee82d9d5d3a4b2af062cfb7e7c3ffb11e5555..e2e3c926ab91d81d559210c6d9178d6b9deec4e7 100644 (file)
@@ -36,7 +36,7 @@ class SimpleScheduler(BaseScheduler):
     2) Select from list up to :count
     """
 
-    def __init__(self, spec):
+    def __init__(self, spec: ServiceSpec):
         super(SimpleScheduler, self).__init__(spec)
 
     def place(self, host_pool, count=None):
@@ -74,7 +74,7 @@ class HostAssignment(object):
     def get_hostnames(self) -> List[str]:
         return [h.hostname for h in self.hosts]
 
-    def validate(self):
+    def validate(self) -> None:
         self.spec.validate()
 
         if self.spec.placement.count == 0:
@@ -186,7 +186,7 @@ class HostAssignment(object):
         # remove duplicates before returning
         return list(dict.fromkeys(active_hosts))
 
-    def prefer_hosts_with_active_daemons(self, hosts: List[HostPlacementSpec], count) -> List[HostPlacementSpec]:
+    def prefer_hosts_with_active_daemons(self, hosts: List[HostPlacementSpec], count: int) -> List[HostPlacementSpec]:
         # try to prefer host with active daemon if possible
         active_hosts = self.get_hosts_with_active_daemon(hosts)
         if len(active_hosts) != 0 and count > 0: