-
-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autocpufreq --version requires sudo now? #530
Comments
Looks like a bug from my previous PR #524 . Searching through the code, I got to know that the A fix may be either :
I will try working on the issue and make an appropriate PR ASAP :-) Till then you can just add an extra (tab) indent on this line. (calling |
set_override method is now called only if force flag is invoked. Here are the specific code changes made: In auto_cpufreq/core.py: - Line 96: Removed the root_check call from the set_override function. This was intended to be done to comply with code template, i.e., to use root_check in the main file. In bin/auto-cpufreq: - Line 45: Added a root_check call before calling set_override in main program. Also, set_override is only called if force option is invoked, saving us from precious extra overheads. Fixes AdnanHodzic#530
Premature return will be the preferred option imo as then it will depend on the More over a check for non-null will also work but not that much what I would like to see. Btw if you do fix it and create a pr tag me as rn have added sudo's in all of my scripts will refactor them. @AdnanHodzic opinion will matter more over it I guess. |
I guess it might be a better design, but at cost of an extra function call. But going through the codes and patterns, they preferred to include root_check in the main file, and not with the associated function. (eg: Due, to this I preferred going with 1st approach with a bit of modifications
It certainly would, I had created an PR and will see what he had to comment on this. |
set_override method is now called only if force flag is invoked. Here are the specific code changes made: In auto_cpufreq/core.py: - Line 96: Removed the root_check call from the set_override function. This was intended to be done to comply with code template, i.e., to use root_check in the main file. In bin/auto-cpufreq: - Line 45: Added a root_check call before calling set_override in main program. Also, set_override is only called if force option is invoked, saving us from precious extra overheads. Fixes AdnanHodzic#530
set_override method is now called only if force flag is invoked. Here are the specific code changes made: In auto_cpufreq/core.py: - Line 96: Removed the root_check call from the set_override function. This was intended to be done to comply with code template, i.e., to use root_check in the main file. In bin/auto-cpufreq: - Line 45: Added a root_check call before calling set_override in main program. Also, set_override is only called if force option is invoked, saving us from precious extra overheads. Fixes #530
any command with autocpu-freq requires sudo?
The text was updated successfully, but these errors were encountered: