Skip to content

use assert_root to check whether user is root when '-r' option is used#116

Open
bpostalci wants to merge 5 commits intogeorgewhewell:masterfrom
bpostalci:master
Open

use assert_root to check whether user is root when '-r' option is used#116
bpostalci wants to merge 5 commits intogeorgewhewell:masterfrom
bpostalci:master

Conversation

@bpostalci
Copy link

@bpostalci bpostalci commented Jun 9, 2020

Closes #46
Old version:

$ undervolt -r
modprobe: ERROR: could not insert 'msr': Operation not permitted
Traceback (most recent call last):
  File "./undervolt.py", line 470, in <module>
    main()
  File "./undervolt.py", line 396, in main
    subprocess.check_call(['modprobe', 'msr'])
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['modprobe', 'msr']' returned non-zero exit status 1.

Fixed version:

$ undervolt -r
You need to have root privileges to run this script with these options.
Rerun with 'sudo'.

Copy link

@A1exKH A1exKH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: could not insert 'msr'

2 participants