From b26327d572dadff9dfa0ed87431a597f93bbb703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Tue, 27 Oct 2015 17:56:09 +0100 Subject: [PATCH] gui: fixed creation of new profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: rhbz#1274609 Signed-off-by: Jaroslav Škarvada --- tuned/consts.py | 1 + tuned/gtk/gui_profile_loader.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tuned/consts.py b/tuned/consts.py index d3eecd7..fe3b588 100644 --- a/tuned/consts.py +++ b/tuned/consts.py @@ -1,5 +1,6 @@ GLOBAL_CONFIG_FILE = "/etc/tuned/tuned-main.conf" ACTIVE_PROFILE_FILE = "/etc/tuned/active_profile" +PROFILE_FILE = "tuned.conf" AUTODETECT_FILE = "recommend.conf" DAEMONIZE_PARENT_TIMEOUT = 5 DBUS_BUS = "com.redhat.tuned" diff --git a/tuned/gtk/gui_profile_loader.py b/tuned/gtk/gui_profile_loader.py index 31d5810..47b2da6 100644 --- a/tuned/gtk/gui_profile_loader.py +++ b/tuned/gtk/gui_profile_loader.py @@ -47,7 +47,7 @@ class GuiProfileLoader(object): def get_raw_profile(self, profile_name): file = self._locate_profile_path(profile_name) + '/' \ - + profile_name + '/' + 'tuned.conf' + + profile_name + '/' + tuned.consts.PROFILE_FILE with open(file, 'r') as f: return f.read() @@ -56,7 +56,7 @@ class GuiProfileLoader(object): profilePath = self._locate_profile_path(profile_name) if profilePath == tuned.consts.LOAD_DIRECTORIES[1]: - file = profilePath + '/' + profile_name + '/' + 'tuned.conf' + file = profilePath + '/' + profile_name + '/' + tuned.consts.PROFILE_FILE with open(file, 'w') as f: f.write(config) else: @@ -65,7 +65,7 @@ class GuiProfileLoader(object): + ' and can not be storet do this location') def load_profile_config(self, profile_name, path): - conf_path = path + '/' + profile_name + '/tuned.conf' + conf_path = path + '/' + profile_name + '/' + tuned.consts.PROFILE_FILE profile_config = configobj.ConfigObj(conf_path) return profile_config @@ -99,7 +99,7 @@ class GuiProfileLoader(object): def save_profile(self, profile): path = tuned.consts.LOAD_DIRECTORIES[1] + '/' + profile.name config = configobj.ConfigObj() - config.filename = path + tuned.consts.CONF_PROFILE_FILE + config.filename = path + '/' + tuned.consts.PROFILE_FILE config.initial_comment = ('#', 'tuned configuration', '#') try: @@ -146,7 +146,7 @@ class GuiProfileLoader(object): self.remove_profile(old_profile_name, is_admin=is_admin) config = configobj.ConfigObj() - config.filename = path + '/tuned.conf' + config.filename = path + '/' + tuned.consts.PROFILE_FILE config.initial_comment = ('#', 'tuned configuration', '#') try: config['main'] = profile.options