From da7c7d16e495fdff6ff3f0229857c750bb5f9153 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 4 Jan 2023 15:12:09 +0800 Subject: [PATCH] Fix starting Dynamips on Windows --- gns3server/compute/dynamips/dynamips_hypervisor.py | 2 ++ gns3server/compute/dynamips/hypervisor.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gns3server/compute/dynamips/dynamips_hypervisor.py b/gns3server/compute/dynamips/dynamips_hypervisor.py index b21e6494..014101bc 100644 --- a/gns3server/compute/dynamips/dynamips_hypervisor.py +++ b/gns3server/compute/dynamips/dynamips_hypervisor.py @@ -94,7 +94,9 @@ class DynamipsHypervisor: try: version = await self.send("hypervisor version") self._version = version[0].split("-", 1)[0] + log.info("Dynamips version {} detected".format(self._version)) except IndexError: + log.warning("Dynamips version could not be detected") self._version = "Unknown" # this forces to send the working dir to Dynamips diff --git a/gns3server/compute/dynamips/hypervisor.py b/gns3server/compute/dynamips/hypervisor.py index 23a67a71..c23a44f2 100644 --- a/gns3server/compute/dynamips/hypervisor.py +++ b/gns3server/compute/dynamips/hypervisor.py @@ -205,7 +205,7 @@ class Hypervisor(DynamipsHypervisor): command = [self._path] command.extend(["-N1"]) # use instance IDs for filenames command.extend(["-l", "dynamips_i{}_log.txt".format(self._id)]) # log file - if parse_version(self.version) >= parse_version('0.2.23'): + if not sys.platform.startswith("win") and parse_version(self.version) >= parse_version('0.2.23'): command.extend(["-H", "{}:{}".format(self._host, self._port), "--console-binding-addr", self._console_host]) else: command.extend(["-H", str(self._port)])