From 37f21075f8e8af2d0f8b51abf0ed1a7da12f4137 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Wed, 18 Mar 2020 10:52:38 +0100 Subject: [PATCH] mgr/dashbaord: orchestrator service: Revert wait_api_result to a single completion Signed-off-by: Sebastian Wagner --- src/pybind/mgr/dashboard/services/orchestrator.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/pybind/mgr/dashboard/services/orchestrator.py b/src/pybind/mgr/dashboard/services/orchestrator.py index 400055c8620c1..8cd499b06f8f3 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 -- 2.39.5