From 581062dd34d70d747384b86b2e968781a9ca9b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Wed, 11 Oct 2017 16:14:00 +0200 Subject: [PATCH] Make errors less verbose in save_active_profile() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hopefully this will make it more user-friendly. Signed-off-by: Ondřej Lysoněk --- tuned/utils/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tuned/utils/commands.py b/tuned/utils/commands.py index 9e31d78..f8e393f 100644 --- a/tuned/utils/commands.py +++ b/tuned/utils/commands.py @@ -500,10 +500,10 @@ class commands: if profile_name is not None: f.write(profile_name + "\n") except (OSError,IOError) as e: - raise TunedException("Cannot write active profile into %s: %s" % (consts.ACTIVE_PROFILE_FILE, str(e))) + raise TunedException("Failed to save active profile: %s" % e.strerror) try: with open(consts.PROFILE_MODE_FILE, "w") as f: mode = consts.ACTIVE_PROFILE_MANUAL if manual else consts.ACTIVE_PROFILE_AUTO f.write(mode + "\n") except (OSError,IOError) as e: - raise TunedException("Cannot write profile mode into %s: %s" % (consts.PROFILE_MODE_FILE, str(e))) + raise TunedException("Failed to save profile mode: %s" % e.strerror)