-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
Fix ST2 Client for Windows Clients #6071
Conversation
For the record, what's the error you're getting on Windows systems? |
Based on the proposed fix CentOS Linux 8
Ubuntu 20.04.6 LTS
Debian GNU/Linux 10 (buster)
Rocky Linux 9.2 (Blue Onyx)
Ubuntu 18.04.6 LTS
Ubuntu 22.04.3 LTS
|
I suspect you might be hitting this issue with your environment python/cpython#84998. As per the recommendation in the issue, perhaps Tested with other OS's,
|
st2client/st2client/base.py
Outdated
# https://docs.python.org/3.8/library/pwd.html | ||
# Windows Default ENVVARS -> https://www.computerhope.com/issues/ch000088.htm | ||
if platform.system() == "Windows": | ||
os.getlogin = lambda: os.environ.get("USERNAME") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, it's worth checking if the default os.getlogin()
works under Windows.
@philipphomberger could you try that?
Something to try before relying on a custom implementation.
If so, we could leave the old workaround conditional for non-windows systems and let Windows rely on native os.getlogin().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good,
Thanks for the fix!
We have try to rollout the st2client on the Windows 10/11 clients of our StackStorm users. But because PWD only exist on Unix Based Operation System it failed.