From: Sebastian Wagner Date: Wed, 18 Mar 2020 10:25:11 +0000 (+0100) Subject: fixup mgr/cephadm: Fix ceph orch apply -i X-Git-Tag: v15.2.0~22^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1a75c46df7380e4afd45e6f85f35fef3f3295067;p=ceph-ci.git fixup mgr/cephadm: Fix ceph orch apply -i Signed-off-by: Sebastian Wagner --- diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index c03753c0dbb..545054d3ea0 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -846,9 +846,28 @@ class Orchestrator(object): def apply(self, specs: List[ServiceSpec]) -> Completion: """ - Saves Service Specs from a yaml|json file - """ - raise NotImplementedError() + Applies any spec + """ + fns = { + 'alertmanager': self.apply_alertmanager, + 'crash': self.apply_crash, + 'grafana': self.apply_grafana, + 'mds': self.apply_mds, + 'mgr': self.apply_mgr, + 'mon': self.apply_mon, + 'nfs': self.apply_nfs, + 'node-exporter': self.apply_node_exporter, + 'osd': self.apply_drivegroups, + 'prometheus': self.apply_prometheus, + 'rbd-mirror': self.apply_rbd_mirror, + 'rgw': self.apply_rgw, + } + spec, [specs] = specs + + completion = fns[spec.service_name](spec) + for s in specs: + completion.then(fns[spec.service_name](spec)) + return completion def remove_daemons(self, names): # type: (List[str]) -> Completion diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index d7bb43bdd80..a0de33fa0c7 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -703,7 +703,7 @@ Usage: completion = self.list_specs(service_name=service_name) self._orchestrator_wait([completion]) raise_if_exception(completion) - specs = completion.result() + specs = completion.result return HandleCommandResult(stdout=yaml.safe_dump_all(specs)) @_cli_write_command(