Option to allow console connections to any local IP address when using the local server.

This commit is contained in:
Jeremy committed 2014-11-09 23:01:13 -07:00
1 parent 1982ff8100
commit f44fbd1f16
12 files changed
+50 -35

No files matched your search

+2 -2
View File
@@ -33,7 +33,6 @@ from gns3server.builtins.interfaces import get_windows_interfaces
from .hypervisor import Hypervisor
from .hypervisor_manager import HypervisorManager
from .dynamips_error import DynamipsError
from ..attic import has_privileged_access
# Nodes
from .nodes.router import Router
@@ -138,6 +137,7 @@ class Dynamips(IModule):
self._tempdir = kwargs["temp_dir"]
self._working_dir = self._projects_dir
self._host = dynamips_config.get("host", kwargs["host"])
self._console_host = dynamips_config.get("console_host", kwargs["console_host"])
if not sys.platform.startswith("win32"):
#FIXME: pickle issues Windows
@@ -282,7 +282,7 @@ class Dynamips(IModule):
raise DynamipsError("Cannot write to working directory {}".format(workdir))
log.info("starting the hypervisor manager with Dynamips working directory set to '{}'".format(workdir))
self._hypervisor_manager = HypervisorManager(self._dynamips, workdir, self._host)
self._hypervisor_manager = HypervisorManager(self._dynamips, workdir, self._host, self._console_host)
for name, value in self._hypervisor_manager_settings.items():
if hasattr(self._hypervisor_manager, name) and getattr(self._hypervisor_manager, name) != value:
@@ -40,14 +40,16 @@ class HypervisorManager(object):
:param path: path to the Dynamips executable
:param working_dir: path to a working directory
:param host: host/address for hypervisors to listen to
:param console_host: IP address to bind for console connections
"""
def __init__(self, path, working_dir, host='127.0.0.1'):
def __init__(self, path, working_dir, host='127.0.0.1', console_host='0.0.0.0'):
self._hypervisors = []
self._path = path
self._working_dir = working_dir
self._host = host
self._console_host = console_host
self._host = console_host # FIXME: Dynamips must be patched to bind on a different address than the one used by the hypervisor.
config = Config.instance()
dynamips_config = config.get_section_config("DYNAMIPS")