From 7cd32bcd6eb500e827e44b2b68195001ef64599b Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Thu, 12 Mar 2020 12:58:49 +0100 Subject: [PATCH] mgr/orch: Properly handle NotImplementedError They are masked as RuntimeError by the mgr. Fixes: https://tracker.ceph.com/issues/44569 Signed-off-by: Sebastian Wagner --- src/pybind/mgr/orchestrator/_interface.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 4330951a5a3..95c1da85348 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -744,7 +744,6 @@ class Orchestrator(object): } return features - @_hide_in_features def cancel_completions(self): # type: () -> None """ @@ -1542,7 +1541,15 @@ class OrchestratorClientMixin(Orchestrator): raise NoOrchestrator() mgr.log.debug("_oremote {} -> {}.{}(*{}, **{})".format(mgr.module_name, o, meth, args, kwargs)) - return mgr.remote(o, meth, *args, **kwargs) + try: + return mgr.remote(o, meth, *args, **kwargs) + except Exception as e: + if meth == 'get_feature_set': + raise # self.get_feature_set() calls self._oremote() + f_set = self.get_feature_set() + if meth not in f_set or not f_set[meth]['available']: + raise NotImplementedError(f'{o} does not implement {meth}') from e + raise def _orchestrator_wait(self, completions): # type: (List[Completion]) -> None -- 2.39.5