If a VM is already loaded, we return a VM instead of creating it twice

Partial fix for #81
This commit is contained in:
Julien Duponchelle committed 2015-03-02 15:35:36 +01:00
1 parent 914ea0326c
commit 66860655b9
2 files changed
+17

No files matched your search

+3
View File
@@ -200,6 +200,9 @@ class BaseManager:
:param vm_id: restore a VM identifier
"""
if vm_id in self._vms:
return self._vms[vm_id]
project = ProjectManager.instance().get_project(project_id)
if vm_id and isinstance(vm_id, int):
with (yield from BaseManager._convert_lock):