1
0
Fork 0

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:
Jaroslav Škarvada 2015-06-04 14:02:02 +02:00
parent 7a868b6be0
commit 7349dbfa5c
5 changed files with 5 additions and 5 deletions

View file

@ -181,7 +181,7 @@ class Application(object):
"""
log.debug("reading and parsing global configuration file '%s'" % consts.GLOBAL_CONFIG_FILE)
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:
raise TunedException("Global tuned configuration file '%s' not found." % file_name)
except ConfigObjError as e:

View file

@ -138,7 +138,7 @@ class GuiPluginLoader(PluginLoader):
try:
config = ConfigObj.ConfigObj(file_name,
configspec=global_config_spec,
raise_errors=True, file_error=True)
raise_errors = True, file_error = True, list_values = False, interpolation = False)
except IOError, e:
raise TunedException("Global tuned configuration file '%s' not found."
% file_name)

View file

@ -75,7 +75,7 @@ class Loader(object):
def _load_config_data(self, file_name):
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:
raise InvalidProfileException("Cannot parse '%s'." % file_name, e)

View file

@ -47,7 +47,7 @@ class Variables():
log.error("unable to find variables_file: '%s'" % filename)
return
try:
config = ConfigObj(filename, raise_errors = True)
config = ConfigObj(filename, raise_errors = True, file_error = True, list_values = False, interpolation = False)
except ConfigObjError:
log.error("error parsing variables_file: '%s'" % filename)
return

View file

@ -113,7 +113,7 @@ class commands:
def recommend_profile(self):
profile = consts.DEFAULT_PROFILE
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()):
match1 = match2 = True
for option in config[section].keys():