Remove --controller

This add too much complexity and it can work
without it.

Fix https://github.com/GNS3/gns3-vm/issues/80, #645
This commit is contained in:
Julien Duponchelle committed 2016-09-07 10:04:28 +02:00
1 parent 9c6ee97ff2
commit f1fe7246e7
7 files changed
+2 -33

No files matched your search

-7
View File
@@ -224,13 +224,6 @@ class Controller:
self._settings = val
self.notification.emit("settings.updated", val)
def is_enabled(self):
"""
:returns: whether the current instance is the controller
of our GNS3 infrastructure.
"""
return Config.instance().get_section_config("Server").getboolean("controller")
@asyncio.coroutine
def add_compute(self, compute_id=None, name=None, force=False, connect=True, **kwargs):
"""
-5
View File
@@ -92,7 +92,6 @@ def parse_arguments(argv):
parser.add_argument("--host", help="run on the given host/IP address")
parser.add_argument("--port", help="run on the given port", type=int)
parser.add_argument("--ssl", action="store_true", help="run in SSL mode")
parser.add_argument("--controller", action="store_true", help="start as a GNS3 controller")
parser.add_argument("--no-ubridge", action="store_false", help="do not use ubridge to handle node connections")
parser.add_argument("--config", help="Configuration file")
parser.add_argument("--certfile", help="SSL cert file")
@@ -124,7 +123,6 @@ def parse_arguments(argv):
"certkey": config.get("certkey", ""),
"record": config.get("record", ""),
"local": config.getboolean("local", False),
"controller": config.getboolean("controller", False),
"use_ubridge": config.getboolean("use_ubridge", True), # this enables uBridge globally
"allow": config.getboolean("allow_remote_console", False),
"quiet": config.getboolean("quiet", False),
@@ -142,7 +140,6 @@ def set_config(args):
config = Config.instance()
server_config = config.get_section_config("Server")
server_config["local"] = str(args.local)
server_config["controller"] = str(args.controller)
server_config["use_ubridge"] = str(args.no_ubridge)
server_config["allow_remote_console"] = str(args.allow)
server_config["host"] = args.host
@@ -227,8 +224,6 @@ def run():
set_config(args)
server_config = Config.instance().get_section_config("Server")
if server_config.getboolean("controller"):
log.info("Controller mode is enabled.")
if server_config.getboolean("local"):
log.warning("Local mode is enabled. Beware, clients will have full control on your filesystem")
-3
View File
@@ -184,9 +184,6 @@ class Route(object):
return response
# API call
if "controller" in func.__module__ and server_config.getboolean("controller", False) is False:
raise aiohttp.web.HTTPForbidden(text="The server is not a controller")
request = yield from parse_request(request, input_schema, raw)
record_file = server_config.get("record")
if record_file:
+2 -4
View File
@@ -102,8 +102,7 @@ class WebServer:
yield from self._handler.finish_connections()
self._handler = None
if Config.instance().get_section_config("Server").getboolean("controller"):
yield from Controller.instance().stop()
yield from Controller.instance().stop()
for module in MODULES:
log.debug("Unloading module {}".format(module.__name__))
@@ -306,8 +305,7 @@ class WebServer:
self._signal_handling()
self._exit_handling()
if server_config.getboolean("controller"):
controller_start = asyncio.async(Controller.instance().start())
controller_start = asyncio.async(Controller.instance().start())
if server_config.getboolean("shell"):
asyncio.async(self.start_shell())