comparison src/tools/config.py @ 1900:d1615f79dfe8

core (tools/config): fixed fixConfigOption: C.DEFAULT_CONFIG was used so the default values were written if not set in the config file used, resulting in a overriding of values set in config files of higher level (e.g. ~/.config/sat/sat.conf could override /etc/sat.conf values).
author Goffi <goffi@goffi.org>
date Wed, 09 Mar 2016 12:11:35 +0100
parents ac2ac7fe8a9b
children 2daf7b4c6756
comparison
equal deleted inserted replaced
1899:7c97554a84d5 1900:d1615f79dfe8
41 @param section (str): the config section 41 @param section (str): the config section
42 @param option (str): the config option 42 @param option (str): the config option
43 @param value (str): the new value 43 @param value (str): the new value
44 @param silent (boolean): toggle logging output (must be True when called from sat.sh) 44 @param silent (boolean): toggle logging output (must be True when called from sat.sh)
45 """ 45 """
46 config = SafeConfigParser(defaults=C.DEFAULT_CONFIG) 46 config = SafeConfigParser()
47 target_file = None 47 target_file = None
48 for file_ in C.CONFIG_FILES[::-1]: 48 for file_ in C.CONFIG_FILES[::-1]:
49 # we will eventually update the existing file with the highest priority, if it's a user personal file... 49 # we will eventually update the existing file with the highest priority, if it's a user personal file...
50 if not silent: 50 if not silent:
51 log.debug(_(u"Testing file %s") % file_) 51 log.debug(_(u"Testing file %s") % file_)