| Total Complexity | 2 | 
| Total Lines | 14 | 
| Duplicated Lines | 0 % | 
| 1 | import eventlet  | 
            ||
| 9 | class VMEditCPUMem(BaseAction):  | 
            ||
| 10 | |||
| 11 | def run(self, vm_id, cpu, memory):  | 
            ||
| 12 | # convert ids to stubs  | 
            ||
| 13 | vm = inventory.get_virtualmachine(self.si_content, moid=vm_id)  | 
            ||
| 14 | spec = vim.vm.ConfigSpec()  | 
            ||
| 15 | spec.numCPUs = cpu  | 
            ||
| 16 | spec.memoryMB = memory  | 
            ||
| 17 | task = vm.ReconfigVM_Task(spec)  | 
            ||
| 18 | |||
| 19 | while task.info.state == vim.TaskInfo.State.running:  | 
            ||
| 20 | eventlet.sleep(1)  | 
            ||
| 21 | |||
| 22 |         return {'state': str(task.info.state)} | 
            ||
| 23 |