Skip to content

Commit

Permalink
Change whoami with os.getlogin to getpass.getuser
Browse files Browse the repository at this point in the history
  • Loading branch information
averevki committed Jan 22, 2024
1 parent e98d70a commit 29f7d92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/settings.local.yaml.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#default:
# skip_cleanup: false
# tester: "someuser" # Optional: name of the user, who is running the tests, defaults to whoami/uid
# gateway_api: true # True, if Testsuite should test with Gateway API enabled (e.g. Full Kuadrant) or individual components (e.g. Authorino)
# cluster: # Workload cluster where tests should run, will get overriden if run on Multicluster
# project: "kuadrant" # Optional: Default namespace for this cluster
Expand Down
3 changes: 2 additions & 1 deletion testsuite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import enum
import json
import os
import getpass
import secrets
from collections.abc import Collection
from copy import deepcopy
Expand Down Expand Up @@ -48,7 +49,7 @@ def _whoami():
return settings["tester"]

try:
return os.getlogin()
return getpass.getuser()
# want to catch broad exception and fallback at any circumstance
# pylint: disable=broad-except
except Exception:
Expand Down

0 comments on commit 29f7d92

Please sign in to comment.