Skip to content

Fix detect-sudo #444

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

Merged
merged 6 commits into from
May 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions script/detect-sudo/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ def get_input():


def prompt_sudo(logger):
if os.geteuid() != 0 and not is_user_in_sudo_group(
logger): # No sudo required for root user
if os.geteuid() != 0: # No sudo required for root user

# Prompt for the password

Expand Down Expand Up @@ -171,7 +170,8 @@ def prompt_sudo(logger):
except subprocess.TimeoutExpired:
logger.info("Timedout")
reset_terminal() # Reset terminal to sane state
if not prompt_retry(): # If the user chooses not to retry or times out
if not prompt_retry(
logger): # If the user chooses not to retry or times out
return -1
except subprocess.CalledProcessError as e:
logger.error(f"Command failed: {e.output}")
Expand Down
Loading