]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: error if service action called with daemonless service
authorAdam King <adking@redhat.com>
Wed, 17 Feb 2021 21:51:30 +0000 (16:51 -0500)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 9 Mar 2021 09:18:50 +0000 (10:18 +0100)
Fixes: https://tracker.ceph.com/issues/49348
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 0618c69dc5255bd407595250c6980cf4929a8ce6)

src/pybind/mgr/cephadm/module.py

index ede8a1c3456f0160f8dd8cc7cda2e4bdf44f1ed9..65128f3127bdb3a6c817cd7d1d9fae05bd76cffc 100644 (file)
@@ -1592,6 +1592,9 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
     @trivial_completion
     def service_action(self, action: str, service_name: str) -> List[str]:
         dds: List[DaemonDescription] = self.cache.get_daemons_by_service(service_name)
+        if not dds:
+            raise OrchestratorError(f'No daemons exist under service name "{service_name}".'
+                                    + ' View currently running services using "ceph orch ls"')
         self.log.info('%s service %s' % (action.capitalize(), service_name))
         return [
             self._schedule_daemon_action(dd.name(), action)