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]: