]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: check if a service exists before trying to restart it 46444/head
authorRedouane Kachach <rkachach@redhat.com>
Tue, 31 May 2022 10:11:03 +0000 (12:11 +0200)
committerRedouane Kachach <rkachach@redhat.com>
Tue, 31 May 2022 10:11:03 +0000 (12:11 +0200)
Fixes: https://tracker.ceph.com/issues/55800
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
src/pybind/mgr/cephadm/module.py

index 766ea77266dc29caceace41a0db71fda291694ed..35ee5c0fa9d494ee1ca396149be8a618f7503699 100644 (file)
@@ -1890,6 +1890,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}".'