From c044822affcf1fb21e4f4d26b18f73f152ea2a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Tue, 26 Nov 2019 15:49:39 +0100 Subject: [PATCH] Fix Traceback on reload when the preset profile does not exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reload_profile_config() method can pass through a TunedException when the requested profile does not exist, or is invalid. We need to catch it and log the error. Resolves: rhbz#1774645 Resolves: rhbz#1702724 Signed-off-by: Ondřej Lysoněk --- tuned/daemon/controller.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tuned/daemon/controller.py b/tuned/daemon/controller.py index 5e1e9ba..48c30ea 100644 --- a/tuned/daemon/controller.py +++ b/tuned/daemon/controller.py @@ -138,7 +138,11 @@ class Controller(tuned.exports.interfaces.ExportableInterface): stop_ok = self.stop() if not stop_ok: return False - self._daemon.reload_profile_config() + try: + self._daemon.reload_profile_config() + except TunedException as e: + log.error("Failed to reload Tuned: %s" % e) + return False return self.start() def _switch_profile(self, profile_name, manual):