mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix to access resources_path and install_builtin_appliances settings
This commit is contained in:
5 files changed
+20
-14
No files matched your search
@@ -271,9 +271,7 @@ class Controller:
|
||||
self._iou_license_settings["license_check"] = iou_config.license_check
|
||||
|
||||
# install the built-in appliances if needed
|
||||
# FIXME
|
||||
server_config = Config.instance().get_section_config("Server")
|
||||
if server_config.getboolean("install_builtin_appliances", True):
|
||||
if Config.instance().settings.Server.install_builtin_appliances:
|
||||
previous_version = controller_vars.get("version")
|
||||
log.info("Comparing controller version {} with config version {}".format(__version__, previous_version))
|
||||
builtin_appliances_path = self._appliance_manager.builtin_appliances_path()
|
||||
|
||||
@@ -100,9 +100,12 @@ class ApplianceManager:
|
||||
Get the built-in appliance storage directory
|
||||
"""
|
||||
|
||||
server_config = Config.instance().get_section_config("Server")
|
||||
appname = vendor = "GNS3"
|
||||
resources_path = os.path.expanduser(server_config.get("resources_path", platformdirs.user_data_dir(appname, vendor, roaming=True)))
|
||||
resources_path = Config.instance().settings.Server.resources_path
|
||||
if not resources_path:
|
||||
appname = vendor = "GNS3"
|
||||
resources_path = platformdirs.user_data_dir(appname, vendor, roaming=True)
|
||||
else:
|
||||
resources_path = os.path.expanduser(resources_path)
|
||||
appliances_dir = os.path.join(resources_path, "appliances")
|
||||
if delete_first:
|
||||
shutil.rmtree(appliances_dir, ignore_errors=True)
|
||||
|
||||
Reference in new issue
Block a user