mirror of
https://github.com/ceph/ceph
synced 2025-04-11 04:02:04 +00:00
mgr/dashbaord: orchestrator service: Revert wait_api_result to a single completion
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
This commit is contained in:
parent
9c12b1b8d3
commit
37f21075f8
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user