Skip to content

Commit

Permalink
Merge pull request ceph#41287 from adk3798/daemon-for-service-warn
Browse files Browse the repository at this point in the history
mgr/cephadm: warn users if they try to pass a daemon to 'orch rm'

Reviewed-by: Juan Miguel Olmo <[email protected]>
  • Loading branch information
tchaikov authored May 20, 2021
2 parents 60c462e + b07efcb commit 30d2910
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pybind/mgr/cephadm/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,12 @@ def remove_service(self, service_name: str) -> str:
return 'Removed service %s' % service_name
else:
# must be idempotent: still a success.
return f'Failed to remove service. <{service_name}> was not found.'
try:
self.cache.get_daemon(service_name)
return (f'Failed to remove service <{service_name}>. "{service_name}" is the name of a daemon, not a service. '
+ 'Running service names can be found with "ceph orch ls"')
except OrchestratorError:
return f'Failed to remove service. <{service_name}> was not found. Running service names can be found with "ceph orch ls"'

@handle_orch_error
def get_inventory(self, host_filter: Optional[orchestrator.InventoryFilter] = None, refresh: bool = False) -> List[orchestrator.InventoryHost]:
Expand Down

0 comments on commit 30d2910

Please sign in to comment.