Index: suite_leahi/shared/scripts/configuration/application_init.py =================================================================== diff -u -r3d68c1dc9aa0aa6efcdf2943989ed888ffc854f6 -r9f922977ecbe83f170f8d6be296539d8242a2fc8 --- suite_leahi/shared/scripts/configuration/application_init.py (.../application_init.py) (revision 3d68c1dc9aa0aa6efcdf2943989ed888ffc854f6) +++ suite_leahi/shared/scripts/configuration/application_init.py (.../application_init.py) (revision 9f922977ecbe83f170f8d6be296539d8242a2fc8) @@ -189,25 +189,27 @@ return aut_version_only def reset_system_setting(setting_key): + """ + Resets a specific setting in System.conf to its default value from System.dflt. """ - Resets a specific setting in System.conf to its default value from System.dflt. - """ base_path = Path.home() / "Public/luis/config/configurations/Settings/" source_file = base_path / "System.dflt" target_file = base_path / "System.conf" - new_value = None search_pattern = f"{setting_key} =" # Read the default value from .dflt with open(source_file, 'r') as f: for line in f: if search_pattern in line: - new_value = line.split("=")[1].strip() - break - + parts = line.split("=") + if len(parts) >= 2: + new_value = parts[1].strip() + # If split fails (len < 2), new_value remains None and loop continues/breaks + break + if new_value is None: - print(f"Setting '{setting_key}' not found in {source_file.name}") + test.log(f"Setting '{setting_key}' not found in {source_file.name}") return # Read the current .conf file