]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: _add_daemon: remove config_func
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 5 Feb 2021 13:14:25 +0000 (14:14 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 23 Feb 2021 09:59:23 +0000 (10:59 +0100)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit 1e3d98ee1e15744c1eb57bba578765bbaeb1096d)

src/pybind/mgr/cephadm/module.py

index 96a08b7330b6be79ef3f4e3e274a5a4fcac7e07b..09fae47d2c37c4fccc64d07f9fcd2e3cbb01ed86 100644 (file)
@@ -1903,8 +1903,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.
@@ -1921,7 +1920,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,
@@ -1929,13 +1928,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:
@@ -1943,11 +1942,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))
@@ -2081,7 +2080,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:
@@ -2089,7 +2088,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:
@@ -2102,7 +2101,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:
@@ -2118,7 +2117,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: