Skip to content

Commit

Permalink
fix: use getpass.getuser
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser committed Oct 25, 2022
1 parent 062e7f3 commit 67e1ec5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion magnum_cluster_api/cmd/image_builder.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import getpass
import json
import os
import subprocess
Expand Down Expand Up @@ -57,7 +58,7 @@ def main(operating_system, version, image_builder_version):

click.echo("- Add current user to KVM group")
subprocess.run(
["sudo", "/usr/sbin/usermod", "-a", "-G", "kvm", os.getlogin()], check=True
["sudo", "/usr/sbin/usermod", "-a", "-G", "kvm", getpass.getuser()], check=True
)

click.echo("- Update permissions for the KVM device")
Expand Down

0 comments on commit 67e1ec5

Please sign in to comment.