Skip to content

Commit

Permalink
Merge pull request #46444 from rkachach/fix_issue_55800
Browse files Browse the repository at this point in the history
mgr/cephadm: check if a service exists before trying to restart it

Reviewed-by: Adam King <adking@redhat.com>
Reviewed-by: Michael Fritch <mfritch@suse.com>
  • Loading branch information
adk3798 committed Jun 2, 2022
2 parents a0486d6 + 6b76753 commit acc573c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pybind/mgr/cephadm/module.py
Expand Up @@ -1890,6 +1890,9 @@ def list_daemons(self,

@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}".'
Expand Down

0 comments on commit acc573c

Please sign in to comment.