Total Complexity | 3 |
Total Lines | 13 |
Duplicated Lines | 0 % |
1 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more |
||
24 | class WaitTask(BaseAction): |
||
25 | |||
26 | def run(self, task_id): |
||
27 | # convert ids to stubs |
||
28 | task = inventory.get_task(self.si_content, moid=task_id) |
||
29 | while task.info.state == vim.TaskInfo.State.running: |
||
30 | eventlet.sleep(1) |
||
31 | result, error = None, None |
||
32 | if task.info.state == vim.TaskInfo.State.success: |
||
33 | result = task.info.result |
||
34 | else: |
||
35 | error = task.info.error |
||
36 | return {'result': result, 'error': error} |
||
37 |