1
0
Fork 0

powertop2tuned: fixed case if the current profile cannot be read

This commit is contained in:
Jaroslav Škarvada 2012-12-04 15:27:43 +01:00
parent ce32245d6f
commit bfe4499580

View file

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