From 208d8778c90452c41271e14a80c1c421cc8f4a54 Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 16 Mar 2022 12:23:15 +0100 Subject: [PATCH] System-Setup: Clean up load data API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don’t need to pass an empty dict as parameter. Co-authored-by: Jean-Baptiste Lallement --- system_setup/common/wsl_conf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system_setup/common/wsl_conf.py b/system_setup/common/wsl_conf.py index 1c55f3d4..4a8fc45e 100644 --- a/system_setup/common/wsl_conf.py +++ b/system_setup/common/wsl_conf.py @@ -60,15 +60,16 @@ conf_type_to_file = { } -def wsl_config_loader(data, config_ref, id): +def wsl_config_loader(config_ref, id): """ Loads the configuration from the given file type, section and reference config. - :param data: dict, the data to load into - :param pathname: string, the path to the file to load + :param config_ref: dict, default entries :param id: string, the name of the section to load + return the data loaded """ + data = {} pathname = conf_type_to_file[id] if not os.path.exists(pathname): return data @@ -103,9 +104,8 @@ def default_loader(is_advanced=False): :param is_advanced: boolean, True if it is WSLConfigurationAdvanced, else is WSLConfigurationBase """ - data = {} conf_ref = config_adv_default if is_advanced else config_base_default - data = wsl_config_loader(data, conf_ref, "wsl") + data = wsl_config_loader(conf_ref, "wsl") return data