1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-26 00:38:10 +00:00

Fix issue when detecting Dynamips version (version is not set until after Dynamips has started)

This commit is contained in:
grossmj 2023-01-04 18:21:17 +08:00
parent e15c36f05c
commit 5459543eb5

View File

@ -24,7 +24,6 @@ import os
import subprocess import subprocess
import asyncio import asyncio
from gns3server.utils import parse_version
from gns3server.utils.asyncio import wait_for_process_termination from gns3server.utils.asyncio import wait_for_process_termination
from .dynamips_hypervisor import DynamipsHypervisor from .dynamips_hypervisor import DynamipsHypervisor
from .dynamips_error import DynamipsError from .dynamips_error import DynamipsError
@ -205,7 +204,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 not sys.platform.startswith("win") and parse_version(self.version) >= parse_version('0.2.23'): if not sys.platform.startswith("win"):
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)])