From: Sebastian Wagner Date: Fri, 5 Feb 2021 13:14:25 +0000 (+0100) Subject: mgr/cephadm: _add_daemon: remove config_func X-Git-Tag: v17.1.0~2962^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F39323%2Fhead;p=ceph.git mgr/cephadm: _add_daemon: remove config_func Signed-off-by: Sebastian Wagner --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index b45a2d2b63d..c2737505b3f 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1895,8 +1895,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, def _add_daemon(self, daemon_type: str, spec: ServiceSpec, - create_func: Callable[..., CephadmDaemonSpec], - config_func: Optional[Callable] = None) -> List[str]: + create_func: Callable[..., CephadmDaemonSpec]) -> List[str]: """ Add (and place) a daemon. Require explicit host placement. Do not schedule, and do not apply the related scheduling limitations. @@ -1913,7 +1912,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, daemons = self.cache.get_daemons_by_service(spec.service_name()) return self._create_daemons(daemon_type, spec, daemons, spec.placement.hosts, count, - create_func, config_func) + create_func) def _create_daemons(self, daemon_type: str, @@ -1921,13 +1920,13 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, daemons: List[DaemonDescription], hosts: List[HostPlacementSpec], count: int, - create_func: Callable[..., CephadmDaemonSpec], - config_func: Optional[Callable] = None) -> List[str]: + create_func: Callable[..., CephadmDaemonSpec]) -> List[str]: if count > len(hosts): raise OrchestratorError('too few hosts: want %d, have %s' % ( count, hosts)) did_config = False + service_type = daemon_type_to_service(daemon_type) args = [] # type: List[CephadmDaemonSpec] for host, network, name in hosts: @@ -1935,11 +1934,11 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, prefix=spec.service_id, forcename=name) - if not did_config and config_func: - config_func(spec, daemon_id) + if not did_config: + self.cephadm_services[service_type].config(spec, daemon_id) did_config = True - daemon_spec = self.cephadm_services[daemon_type_to_service(daemon_type)].make_daemon_spec( + daemon_spec = self.cephadm_services[service_type].make_daemon_spec( host, daemon_id, network, spec) self.log.debug('Placing %s.%s on host %s' % ( daemon_type, daemon_id, host)) @@ -2073,7 +2072,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, @trivial_completion def add_mds(self, spec: ServiceSpec) -> List[str]: - return self._add_daemon('mds', spec, self.mds_service.prepare_create, self.mds_service.config) + return self._add_daemon('mds', spec, self.mds_service.prepare_create) @trivial_completion def apply_mds(self, spec: ServiceSpec) -> str: @@ -2081,7 +2080,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, @trivial_completion def add_rgw(self, spec: ServiceSpec) -> List[str]: - return self._add_daemon('rgw', spec, self.rgw_service.prepare_create, self.rgw_service.config) + return self._add_daemon('rgw', spec, self.rgw_service.prepare_create) @trivial_completion def apply_rgw(self, spec: ServiceSpec) -> str: @@ -2094,7 +2093,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, @trivial_completion def add_iscsi(self, spec): # type: (ServiceSpec) -> List[str] - return self._add_daemon('iscsi', spec, self.iscsi_service.prepare_create, self.iscsi_service.config) + return self._add_daemon('iscsi', spec, self.iscsi_service.prepare_create) @trivial_completion def apply_iscsi(self, spec: ServiceSpec) -> str: @@ -2110,7 +2109,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, @trivial_completion def add_nfs(self, spec: ServiceSpec) -> List[str]: - return self._add_daemon('nfs', spec, self.nfs_service.prepare_create, self.nfs_service.config) + return self._add_daemon('nfs', spec, self.nfs_service.prepare_create) @trivial_completion def apply_nfs(self, spec: ServiceSpec) -> str: