From e182f53d69f51e9addbdc2ced94d272cfebeccab Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 4 Nov 2020 12:30:23 +1030 Subject: [PATCH] Fix wrong defaults for images_path, configs_path, appliances_path. Fixes #1829 --- gns3server/controller/__init__.py | 10 +++++----- gns3server/controller/appliance_manager.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index d3a3489b..14dc6196 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -82,7 +82,7 @@ class Controller: computes = self._load_controller_settings() from gns3server.web.web_server import WebServer - ssl_context = WebServer.instance().ssl_context() + ssl_context = WebServer.instance(host=host, port=port).ssl_context() protocol = server_config.get("protocol", "http") if ssl_context and protocol != "https": log.warning("Protocol changed to 'https' for local compute because SSL is enabled".format(port)) @@ -273,7 +273,7 @@ class Controller: """ server_config = Config.instance().get_section_config("Server") - images_path = os.path.expanduser(server_config.get("images_path", "~/GNS3/projects")) + images_path = os.path.expanduser(server_config.get("images_path", "~/GNS3/images")) os.makedirs(images_path, exist_ok=True) return images_path @@ -283,9 +283,9 @@ class Controller: """ server_config = Config.instance().get_section_config("Server") - images_path = os.path.expanduser(server_config.get("configs_path", "~/GNS3/projects")) - os.makedirs(images_path, exist_ok=True) - return images_path + configs_path = os.path.expanduser(server_config.get("configs_path", "~/GNS3/configs")) + os.makedirs(configs_path, exist_ok=True) + return configs_path async def add_compute(self, compute_id=None, name=None, force=False, connect=True, **kwargs): """ diff --git a/gns3server/controller/appliance_manager.py b/gns3server/controller/appliance_manager.py index 17c7fd30..e0ea0a4a 100644 --- a/gns3server/controller/appliance_manager.py +++ b/gns3server/controller/appliance_manager.py @@ -70,7 +70,7 @@ class ApplianceManager: """ server_config = Config.instance().get_section_config("Server") - appliances_path = os.path.expanduser(server_config.get("appliances_path", "~/GNS3/projects")) + appliances_path = os.path.expanduser(server_config.get("appliances_path", "~/GNS3/appliances")) os.makedirs(appliances_path, exist_ok=True) return appliances_path