From: Sebastian Wagner Date: Thu, 12 Mar 2020 11:58:49 +0000 (+0100) Subject: mgr/orch: Properly handle NotImplementedError X-Git-Tag: v15.1.1~12^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7cd32bcd6eb500e827e44b2b68195001ef64599b;p=ceph.git 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 --- diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 4330951a5a34..95c1da85348b 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