]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: error if service action called with daemonless service 39537/head
authorAdam King <adking@redhat.com>
Wed, 17 Feb 2021 21:51:30 +0000 (16:51 -0500)
committerAdam King <adking@redhat.com>
Wed, 17 Feb 2021 21:54:47 +0000 (16:54 -0500)
Fixes: https://tracker.ceph.com/issues/49348
Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/module.py

index ae79d89e3784033538f55bd591dfe977ca7ab82d..54a36375db34edfa09cc040fd22b70a95e80ddd2 100644 (file)
@@ -1584,6 +1584,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)