From: Sebastian Wagner Date: Wed, 18 Mar 2020 09:52:38 +0000 (+0100) Subject: mgr/dashbaord: orchestrator service: Revert wait_api_result to a single completion X-Git-Tag: v15.2.0~22^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=37f21075f8e8af2d0f8b51abf0ed1a7da12f4137;p=ceph.git mgr/dashbaord: orchestrator service: Revert wait_api_result to a single completion Signed-off-by: Sebastian Wagner --- diff --git a/src/pybind/mgr/dashboard/services/orchestrator.py b/src/pybind/mgr/dashboard/services/orchestrator.py index 400055c8620c..8cd499b06f8f 100644 --- a/src/pybind/mgr/dashboard/services/orchestrator.py +++ b/src/pybind/mgr/dashboard/services/orchestrator.py @@ -36,15 +36,10 @@ class OrchestratorAPI(OrchestratorClientMixin): def wait_api_result(method): @wraps(method) def inner(self, *args, **kwargs): - completions = method(self, *args, **kwargs) - if not isinstance(completions, list): - completions = [completions] - self.api.orchestrator_wait(completions) - for compl in completions: - raise_if_exception(compl) - if len(completions) == 1: - return completions[0].result - return [compl.result for compl in completions] + completion = method(self, *args, **kwargs) + self.api.orchestrator_wait([completion]) + raise_if_exception(completion) + return completion.result return inner