From: Adam King Date: Tue, 11 May 2021 17:47:55 +0000 (-0400) Subject: mgr/cephadm: warn users if they try to pass a daemon to 'orch rm' X-Git-Tag: v17.1.0~1904^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b07efcb4192ad5988baf3bb92df42cea877a8351;p=ceph.git mgr/cephadm: warn users if they try to pass a daemon to 'orch rm' Signed-off-by: Adam King --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index fa904b21e3ae..a95deb8d37e5 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1910,7 +1910,12 @@ Then run the following: 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]: