]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: check if a service exists before trying to restart it 46779/head
authorRedouane Kachach <rkachach@redhat.com>
Tue, 31 May 2022 10:11:03 +0000 (12:11 +0200)
committerAdam King <adking@redhat.com>
Tue, 21 Jun 2022 17:03:20 +0000 (13:03 -0400)
Fixes: https://tracker.ceph.com/issues/55800
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit 6b76753c3cabf9663fa1daa47c7bcb7df110a94c)

src/pybind/mgr/cephadm/module.py

index 2c80175fb4738c53005086cc8d07b7e205d7e168..0f69382684c2b311b694db0295ea0cc4da79d80a 100644 (file)
@@ -2000,6 +2000,9 @@ Then run the following:
 
     @handle_orch_error
     def service_action(self, action: str, service_name: str) -> List[str]:
+        if service_name not in self.spec_store.all_specs.keys():
+            raise OrchestratorError(f'Invalid service name "{service_name}".'
+                                    + ' View currently running services using "ceph orch ls"')
         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}".'