configobj: parse lists as strings and do not interpolate strings
Fixed in all parsers (main config, profiles, variables and recommend). Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
7a868b6be0
commit
7349dbfa5c
5 changed files with 5 additions and 5 deletions
|
|
@ -181,7 +181,7 @@ class Application(object):
|
||||||
"""
|
"""
|
||||||
log.debug("reading and parsing global configuration file '%s'" % consts.GLOBAL_CONFIG_FILE)
|
log.debug("reading and parsing global configuration file '%s'" % consts.GLOBAL_CONFIG_FILE)
|
||||||
try:
|
try:
|
||||||
config = ConfigObj(file_name, configspec=global_config_spec, raise_errors = True, file_error = True)
|
config = ConfigObj(file_name, configspec=global_config_spec, raise_errors = True, file_error = True, list_values = False, interpolation = False)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
raise TunedException("Global tuned configuration file '%s' not found." % file_name)
|
raise TunedException("Global tuned configuration file '%s' not found." % file_name)
|
||||||
except ConfigObjError as e:
|
except ConfigObjError as e:
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ class GuiPluginLoader(PluginLoader):
|
||||||
try:
|
try:
|
||||||
config = ConfigObj.ConfigObj(file_name,
|
config = ConfigObj.ConfigObj(file_name,
|
||||||
configspec=global_config_spec,
|
configspec=global_config_spec,
|
||||||
raise_errors=True, file_error=True)
|
raise_errors = True, file_error = True, list_values = False, interpolation = False)
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
raise TunedException("Global tuned configuration file '%s' not found."
|
raise TunedException("Global tuned configuration file '%s' not found."
|
||||||
% file_name)
|
% file_name)
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ class Loader(object):
|
||||||
|
|
||||||
def _load_config_data(self, file_name):
|
def _load_config_data(self, file_name):
|
||||||
try:
|
try:
|
||||||
config_obj = ConfigObj(file_name, raise_errors=True)
|
config_obj = ConfigObj(file_name, raise_errors = True, list_values = False, interpolation = False)
|
||||||
except ConfigObjError as e:
|
except ConfigObjError as e:
|
||||||
raise InvalidProfileException("Cannot parse '%s'." % file_name, e)
|
raise InvalidProfileException("Cannot parse '%s'." % file_name, e)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class Variables():
|
||||||
log.error("unable to find variables_file: '%s'" % filename)
|
log.error("unable to find variables_file: '%s'" % filename)
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
config = ConfigObj(filename, raise_errors = True)
|
config = ConfigObj(filename, raise_errors = True, file_error = True, list_values = False, interpolation = False)
|
||||||
except ConfigObjError:
|
except ConfigObjError:
|
||||||
log.error("error parsing variables_file: '%s'" % filename)
|
log.error("error parsing variables_file: '%s'" % filename)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ class commands:
|
||||||
def recommend_profile(self):
|
def recommend_profile(self):
|
||||||
profile = consts.DEFAULT_PROFILE
|
profile = consts.DEFAULT_PROFILE
|
||||||
for f in consts.LOAD_DIRECTORIES:
|
for f in consts.LOAD_DIRECTORIES:
|
||||||
config = ConfigObj(os.path.join(f, consts.AUTODETECT_FILE))
|
config = ConfigObj(os.path.join(f, consts.AUTODETECT_FILE), list_values = False, interpolation = False)
|
||||||
for section in reversed(config.keys()):
|
for section in reversed(config.keys()):
|
||||||
match1 = match2 = True
|
match1 = match2 = True
|
||||||
for option in config[section].keys():
|
for option in config[section].keys():
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue