mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-21 00:22:56 +00:00
Merge branch '2.2' into 3.0
# Conflicts: # README.md # gns3server/compute/base_node.py # gns3server/compute/dynamips/__init__.py # gns3server/compute/dynamips/hypervisor.py # gns3server/compute/qemu/__init__.py # gns3server/compute/qemu/qemu_vm.py # gns3server/controller/__init__.py # gns3server/crash_report.py # gns3server/handlers/api/controller/node_handler.py # gns3server/schemas/qemu_template.py # gns3server/static/web-ui/index.html # gns3server/static/web-ui/main.11410ae4eaf4d4c08cd0.js # gns3server/version.py # requirements.txt
This commit is contained in:
@ -46,7 +46,7 @@ class Hypervisor(DynamipsHypervisor):
|
||||
|
||||
_instance_count = 1
|
||||
|
||||
def __init__(self, path, working_dir, host, port, console_host):
|
||||
def __init__(self, path, working_dir, host, port, console_host, bind_console_host=False):
|
||||
|
||||
super().__init__(working_dir, host, port)
|
||||
|
||||
@ -55,6 +55,7 @@ class Hypervisor(DynamipsHypervisor):
|
||||
Hypervisor._instance_count += 1
|
||||
|
||||
self._console_host = console_host
|
||||
self._bind_console_host = bind_console_host
|
||||
self._path = path
|
||||
self._command = []
|
||||
self._process = None
|
||||
@ -196,9 +197,13 @@ class Hypervisor(DynamipsHypervisor):
|
||||
|
||||
command = [self._path]
|
||||
command.extend(["-N1"]) # use instance IDs for filenames
|
||||
command.extend(["-l", f"dynamips_i{self._id}_log.txt"]) # log file
|
||||
if not sys.platform.startswith("win"):
|
||||
command.extend(["-H", f"{self._host}:{self._port}", "--console-binding-addr", self._console_host])
|
||||
command.extend(["-l", "dynamips_i{}_log.txt".format(self._id)]) # log file
|
||||
|
||||
if self._bind_console_host:
|
||||
# support was added in Dynamips version 0.2.23
|
||||
command.extend(["-H", "{}:{}".format(self._host, self._port), "--console-binding-addr", self._console_host])
|
||||
elif self._console_host != "0.0.0.0" and self._console_host != "::":
|
||||
command.extend(["-H", "{}:{}".format(self._host, self._port)])
|
||||
else:
|
||||
command.extend(["-H", str(self._port)])
|
||||
|
||||
|
Reference in New Issue
Block a user