From 66c56a002e604c24799cd950cac6455b5ebb9861 Mon Sep 17 00:00:00 2001 From: Redouane Kachach Date: Wed, 9 Mar 2022 14:19:02 +0100 Subject: [PATCH] mgr/cephadm: checking service name before removal Fixes: https://tracker.ceph.com/issues/54503 Signed-off-by: Redouane Kachach (cherry picked from commit b26c114c8456941d6cccf7d4355445f21cb373a7) --- src/pybind/mgr/cephadm/module.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index f40bd7f5a49da..94c42df9abf11 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.'): -- 2.39.5