From: Sebastian Wagner Date: Thu, 20 Feb 2020 09:39:28 +0000 (+0100) Subject: mgr/cephadm: NodeAssignment.get_hosts_func now returns List[str] X-Git-Tag: v15.1.1~321^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=66201eceb37c8b0fa5a37281253a796510804d6a;p=ceph-ci.git mgr/cephadm: NodeAssignment.get_hosts_func now returns List[str] Signed-off-by: Sebastian Wagner --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index da57a801a8e..e86da48eb4c 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2469,7 +2469,7 @@ class NodeAssignment(object): def __init__(self, spec=None, # type: Optional[orchestrator.ServiceSpec] scheduler=None, # type: Optional[BaseScheduler] - get_hosts_func=None, # type: Optional[Callable] + get_hosts_func=None, # type: Optional[Callable[[],List[str]]] service_type=None, # type: Optional[str] ): assert spec and get_hosts_func and service_type @@ -2497,7 +2497,7 @@ class NodeAssignment(object): # NOTE: This currently queries for all hosts without label restriction if self.spec.placement.label: logger.info("Found labels. Assigning nodes that match the label") - candidates = [HostPlacementSpec(x[0], '', '') for x in self.get_hosts_func()] # TODO: query for labels + candidates = [HostPlacementSpec(x, '', '') for x in self.get_hosts_func()] # TODO: query for labels logger.info('Assigning nodes to spec: {}'.format(candidates)) self.spec.placement.set_hosts(candidates)