From 281fc7d775fb82f73593d249c0d28424daba6ae9 Mon Sep 17 00:00:00 2001 From: Kiefer Chang Date: Tue, 10 Mar 2020 15:22:40 +0800 Subject: [PATCH] mgr/cephadm: fix service list filtering We should apply filters on ServiceSpecs in store too, or services are returned even filters are applied during collecting daemons. Fixes: https://tracker.ceph.com/issues/44512 Signed-off-by: Kiefer Chang --- src/pybind/mgr/cephadm/module.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 8272bee58c317..9767c167b9965 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1729,6 +1729,10 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): for n, spec in self.spec_store.specs.items(): if n in sm: continue + if service_type is not None and service_type != spec.service_type: + continue + if service_name is not None and service_name != n: + continue sm[n] = orchestrator.ServiceDescription( service_name=n, spec=spec, -- 2.39.5