From bfe44995805363b51d1735b63f124574c645a16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Tue, 4 Dec 2012 15:27:43 +0100 Subject: [PATCH] powertop2tuned: fixed case if the current profile cannot be read --- experiments/powertop2tuned.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experiments/powertop2tuned.py b/experiments/powertop2tuned.py index fa9698b..dfcc911 100755 --- a/experiments/powertop2tuned.py +++ b/experiments/powertop2tuned.py @@ -172,7 +172,7 @@ class PowertopProfile: output = proc.communicate()[0] if output and output.find("Current active profile: ") == 0: return output[len("Current active profile: "):output.find("\n")] - return "unknown" + return None def checkPrivs(self): myuid = os.geteuid() @@ -218,7 +218,7 @@ class PowertopProfile: print "Generating Tuned config file", os.path.join(self.output, "tuned.conf") f = codecs.open(os.path.join(self.output, "tuned.conf"), "w", "utf-8") f.write(TUNED_CONF_PROLOG) - if not new_profile: + if not new_profile and profile is not None: f.write(TUNED_CONF_INCLUDE % ("include=" + profile)) for plugin in plugins.values():