Fixes module unload & adds host, port and allow-remote-console command line args.

This commit is contained in:
Jeremy committed 2015-01-23 13:01:23 -07:00
1 parent 59f940625a
commit 39e3ca91a9
6 files changed
+36 -23

No files matched your search

+1
View File
@@ -106,6 +106,7 @@ class BaseManager:
if hasattr(BaseManager, "_instance"):
BaseManager._instance = None
log.debug("Module {} unloaded".format(self.module_name))
def get_vm(self, uuid):
"""
+10 -4
View File
@@ -17,17 +17,19 @@
import socket
import ipaddress
import asyncio
from aiohttp.web import HTTPConflict
from gns3server.config import Config
import logging
log = logging.getLogger(__name__)
class PortManager:
"""
:param host: IP address to bind for console connections
"""
def __init__(self, host="127.0.0.1", console_bind_to_any=False):
def __init__(self, host="127.0.0.1"):
self._console_host = host
self._udp_host = host
@@ -37,7 +39,11 @@ class PortManager:
self._used_tcp_ports = set()
self._used_udp_ports = set()
if console_bind_to_any:
server_config = Config.instance().get_section_config("Server")
remote_console_connections = server_config.getboolean("allow_remote_console")
if remote_console_connections:
log.warning("Remote console connections are allowed")
if ipaddress.ip_address(host).version == 6:
self._console_host = "::"
else: