1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Fix starting Dynamips on Windows

This commit is contained in:
grossmj 2023-01-04 15:12:09 +08:00
parent eb1b70456f
commit da7c7d16e4
2 changed files with 3 additions and 1 deletions

View File

@ -94,7 +94,9 @@ class DynamipsHypervisor:
try: try:
version = await self.send("hypervisor version") version = await self.send("hypervisor version")
self._version = version[0].split("-", 1)[0] self._version = version[0].split("-", 1)[0]
log.info("Dynamips version {} detected".format(self._version))
except IndexError: except IndexError:
log.warning("Dynamips version could not be detected")
self._version = "Unknown" self._version = "Unknown"
# this forces to send the working dir to Dynamips # this forces to send the working dir to Dynamips

View File

@ -205,7 +205,7 @@ class Hypervisor(DynamipsHypervisor):
command = [self._path] command = [self._path]
command.extend(["-N1"]) # use instance IDs for filenames command.extend(["-N1"]) # use instance IDs for filenames
command.extend(["-l", "dynamips_i{}_log.txt".format(self._id)]) # log file 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]) command.extend(["-H", "{}:{}".format(self._host, self._port), "--console-binding-addr", self._console_host])
else: else:
command.extend(["-H", str(self._port)]) command.extend(["-H", str(self._port)])