From 1d4e683b6c9f475232e8e70eb7b776ddb440da57 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 29 Feb 2020 15:55:40 -0600 Subject: [PATCH] mgr/cephadm: catch and log exceptions from apply Signed-off-by: Sage Weil --- src/pybind/mgr/cephadm/module.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index c39c9abc34c..a415568bdd3 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2813,7 +2813,11 @@ receivers: specs = self.spec_store.find(service_name) completions = list() for spec in specs: - completions.append(func(spec)) + try: + completions.append(func(spec)) + except Exception as e: + self.log.warning('Failed to apply %s spec %s: %s' % ( + service_name, spec, e)) if completions: return completions return [trivial_result("Nothing to do..")] -- 2.39.5