Suspend the GNS3 VM

Fix #656
This commit is contained in:
Julien Duponchelle committed 2016-09-08 15:32:35 +02:00
1 parent cfe834afc4
commit 1412462229
8 files changed
+114 -42

No files matched your search

+8 -2
View File
@@ -88,7 +88,7 @@ class Controller:
# We don't care if a compute is down at this step
except aiohttp.errors.ClientOSError:
pass
yield from self.gns3vm.auto_stop_vm()
yield from self.gns3vm.exit_vm()
self._computes = {}
self._projects = {}
@@ -204,10 +204,16 @@ class Controller:
for compute in self._computes.values():
if compute.host == vm_settings.get("remote_vm_host") and compute.port == vm_settings.get("remote_vm_port"):
vmname = compute.name
if vm_settings.get("auto_stop", True):
when_exit = "stop"
else:
when_exit = "keep"
self.gns3vm.settings = {
"engine": engine,
"enable": vm_settings.get("auto_start", False),
"auto_stop": vm_settings.get("auto_stop", True),
"when_exit": when_exit,
"headless": vm_settings.get("headless", False),
"vmname": vmname
}