mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Should fix ProcessLookupError exceptions.
This commit is contained in:
1 parent
1610067eee
commit
223f3ee705
5 files changed
+21
-16
No files matched your search
@@ -494,12 +494,12 @@ class Dynamips(BaseManager):
|
||||
yield from vm.set_sparsemem(False)
|
||||
|
||||
# update the configs if needed
|
||||
yield from self.create_vm_configs(vm, settings)
|
||||
yield from self.set_vm_configs(vm, settings)
|
||||
|
||||
@asyncio.coroutine
|
||||
def create_vm_configs(self, vm, settings):
|
||||
def set_vm_configs(self, vm, settings):
|
||||
"""
|
||||
Creates VM configs from pushed content.
|
||||
Set VM configs from pushed content or existing config files.
|
||||
|
||||
:param vm: VM instance
|
||||
:param settings: VM settings
|
||||
@@ -514,16 +514,18 @@ class Dynamips(BaseManager):
|
||||
startup_config_path = self._create_config(vm, startup_config_content, default_startup_config_path)
|
||||
yield from vm.set_configs(startup_config_path)
|
||||
else:
|
||||
startup_config_path = settings.get("startup_config", "")
|
||||
yield from vm.set_configs(startup_config_path)
|
||||
startup_config_path = settings.get("startup_config")
|
||||
if startup_config_path:
|
||||
yield from vm.set_configs(startup_config_path)
|
||||
|
||||
private_config_content = settings.get("private_config_content")
|
||||
if private_config_content:
|
||||
private_config_path = self._create_config(vm, private_config_content, default_private_config_path)
|
||||
yield from vm.set_configs(vm.startup_config, private_config_path)
|
||||
else:
|
||||
private_config_path = settings.get("private_config", "")
|
||||
yield from vm.set_configs(vm.startup_config, private_config_path)
|
||||
private_config_path = settings.get("private_config")
|
||||
if private_config_path:
|
||||
yield from vm.set_configs(vm.startup_config, private_config_path)
|
||||
|
||||
def _create_config(self, vm, content, path):
|
||||
"""
|
||||
|
||||
@@ -138,9 +138,9 @@ class Hypervisor(DynamipsHypervisor):
|
||||
try:
|
||||
yield from asyncio.wait_for(self._process.wait(), timeout=3)
|
||||
except asyncio.TimeoutError:
|
||||
self._process.kill()
|
||||
if self._process.returncode is None:
|
||||
log.warn("Dynamips process {} is still running".format(self._process.pid))
|
||||
log.warn("Dynamips process {} is still running... killing it".format(self._process.pid))
|
||||
self._process.kill()
|
||||
|
||||
if self._stdout_file and os.access(self._stdout_file, os.W_OK):
|
||||
try:
|
||||
|
||||
@@ -1249,6 +1249,8 @@ class Router(BaseVM):
|
||||
port_number=port_number))
|
||||
|
||||
nio = adapter.get_nio(port_number)
|
||||
if nio is None:
|
||||
return
|
||||
if isinstance(nio, NIOUDP):
|
||||
self.manager.port_manager.release_udp_port(nio.lport)
|
||||
adapter.remove_nio(port_number)
|
||||
|
||||
Reference in new issue
Block a user