Completed
Pull Request — master (#460)
by Manas
02:32
created

StartVM.run()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 7
rs 9.4285
cc 1
1
from pyVmomi import vim
2
3
from vmwarelib import inventory
4
from vmwarelib.actions import BaseAction
5
6
7
class StartVM(BaseAction):
8
9
    def run(self, vm):
10
        si = self.si
11
        vm_obj = vim.VirtualMachine(vm, stub=si._stub)
12
13
        task = vm_obj.PowerOnVM_Task(None)
14
        success = self._wait_for_task(task)
15
        return {'success': success}
16