mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Delete VPCS
This commit is contained in:
1 parent
545a3d2b58
commit
e12e6044dc
5 files changed
+53
-1
No files matched your search
@@ -132,3 +132,18 @@ class BaseManager:
|
||||
vm.create()
|
||||
self._vms[vm.uuid] = vm
|
||||
return vm
|
||||
|
||||
@asyncio.coroutine
|
||||
def delete_vm(self, uuid):
|
||||
"""
|
||||
Delete a VM
|
||||
|
||||
:param uuid: VM UUID
|
||||
"""
|
||||
|
||||
vm = self.get_vm(uuid)
|
||||
if asyncio.iscoroutinefunction(vm.destroy):
|
||||
yield from vm.destroy()
|
||||
else:
|
||||
vm.destroy()
|
||||
del self._vms[vm.uuid]
|
||||
@@ -82,7 +82,13 @@ class VPCSVM(BaseVM):
|
||||
self._console = self._manager.port_manager.get_free_console_port()
|
||||
|
||||
def __del__(self):
|
||||
self.destroy()
|
||||
|
||||
def destroy(self):
|
||||
self._kill_process()
|
||||
if self._console:
|
||||
self._manager.port_manager.release_console_port(self._console)
|
||||
self._console = None
|
||||
|
||||
@asyncio.coroutine
|
||||
def _check_requirements(self):
|
||||
|
||||
Reference in new issue
Block a user