From: Redouane Kachach Date: Wed, 9 Mar 2022 13:19:02 +0000 (+0100) Subject: mgr/cephadm: checking service name before removal X-Git-Tag: v16.2.8~27^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=66c56a002e604c24799cd950cac6455b5ebb9861;p=ceph.git mgr/cephadm: checking service name before removal Fixes: https://tracker.ceph.com/issues/54503 Signed-off-by: Redouane Kachach (cherry picked from commit b26c114c8456941d6cccf7d4355445f21cb373a7) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index f40bd7f5a49d..94c42df9abf1 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2106,6 +2106,8 @@ Then run the following: if self.spec_store[service_name].spec.service_type in ('mon', 'mgr'): return f'Unable to remove {service_name} service.\n' \ f'Note, you might want to mark the {service_name} service as "unmanaged"' + else: + return f"Invalid service '{service_name}'. Use 'ceph orch ls' to list available services.\n" # Report list of affected OSDs? if not force and service_name.startswith('osd.'):