| Total Complexity | 2 |
| Total Lines | 9 |
| Duplicated Lines | 0 % |
| 1 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more |
||
| 24 | class VMPowerOn(BaseAction): |
||
| 25 | |||
| 26 | def run(self, vm_id): |
||
| 27 | # convert ids to stubs |
||
| 28 | vm = inventory.get_virtualmachine(self.si_content, moid=vm_id) |
||
| 29 | task = vm.PowerOnVM_Task(None) |
||
| 30 | while task.info.state == vim.TaskInfo.State.running: |
||
| 31 | eventlet.sleep(1) |
||
| 32 | return {'state': str(task.info.state)} |
||
| 33 |