From 7349dbfa5cba3200535ac0622fbf8bd3be5d0acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 4 Jun 2015 14:02:02 +0200 Subject: [PATCH] configobj: parse lists as strings and do not interpolate strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed in all parsers (main config, profiles, variables and recommend). Signed-off-by: Jaroslav Škarvada --- tuned/daemon/application.py | 2 +- tuned/gtk/gui_plugin_loader.py | 2 +- tuned/profiles/loader.py | 2 +- tuned/profiles/variables.py | 2 +- tuned/utils/commands.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tuned/daemon/application.py b/tuned/daemon/application.py index e2cdb01..9adcc16 100644 --- a/tuned/daemon/application.py +++ b/tuned/daemon/application.py @@ -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: diff --git a/tuned/gtk/gui_plugin_loader.py b/tuned/gtk/gui_plugin_loader.py index a3d7a90..60a4135 100644 --- a/tuned/gtk/gui_plugin_loader.py +++ b/tuned/gtk/gui_plugin_loader.py @@ -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) diff --git a/tuned/profiles/loader.py b/tuned/profiles/loader.py index bd039c6..6991969 100644 --- a/tuned/profiles/loader.py +++ b/tuned/profiles/loader.py @@ -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) diff --git a/tuned/profiles/variables.py b/tuned/profiles/variables.py index 9ff0a84..a1b6272 100644 --- a/tuned/profiles/variables.py +++ b/tuned/profiles/variables.py @@ -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 diff --git a/tuned/utils/commands.py b/tuned/utils/commands.py index 0d8c313..dd95a13 100644 --- a/tuned/utils/commands.py +++ b/tuned/utils/commands.py @@ -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():