Adding root_check before set_override method execution (#524)
This will ensure that set_override calls are always in su mode. So, in effect all override using 'force' can clearly access the governer_override_state path file, and write changes to it, without externally tinkering the environment.
This commit is contained in:
parent
d593e3e839
commit
486a9a6dc2
|
@ -96,6 +96,7 @@ def get_override():
|
||||||
return "default"
|
return "default"
|
||||||
|
|
||||||
def set_override(override):
|
def set_override(override):
|
||||||
|
root_check() # Calling root_check inside if and elif might be too verbose and is susceptible to bugs in future
|
||||||
if override in ["powersave", "performance"]:
|
if override in ["powersave", "performance"]:
|
||||||
with open(governor_override_state, "wb") as store:
|
with open(governor_override_state, "wb") as store:
|
||||||
pickle.dump(override, store)
|
pickle.dump(override, store)
|
||||||
|
|
Loading…
Reference in New Issue