Skip to content

Commit

Permalink
fix: improve userctl
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkolenz committed Dec 13, 2023
1 parent 87a6779 commit 07c3f46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Please do **not** use the standard Linux commands (e.g., `useradd`, `adduser`, .
The script is interactive and allows to add, remove, and edit users.
Please run `sudo userctl --help` for more information.

Users on this server are identified by their university email address.
Thus, `userctl` expects the full email address as argument.

## Process Management

Some users may forget to stop their processes or block all GPUs at once.
Expand Down
4 changes: 3 additions & 1 deletion modules/userctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def run_cmd(cmd: Sequence[str], **kwargs) -> str:

def check_email(user: str):
if not user.endswith("@uni-trier.de"):
raise typer.BadParameter("Only university mail addresses are allowed")
raise typer.BadParameter(
"Please provide the university email address, the script determines the username automatically"
)

return user.split("@")[0]

Expand Down

0 comments on commit 07c3f46

Please sign in to comment.