1
0
Fork 0

Make errors less verbose in save_active_profile()

Hopefully this will make it more user-friendly.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
Ondřej Lysoněk 2017-10-11 16:14:00 +02:00
parent f32f2a3ecc
commit 581062dd34

View file

@ -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)