-
Notifications
You must be signed in to change notification settings - Fork 1
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
test whether postgres user exists #25
Conversation
4d25835
to
805b5a4
Compare
So far, `pgsu` only tried the "sudo route" when it detected that it was running on Ubuntu Linux. It was reported that this test can fail when running on Windows Subsystem for Linux. Furthermore, this test might be too strict and exclude other Linux distributions with similar postgresql setup (unverified). Here, we switch from the check of the distribution name to a check whether the `postgres` system user exists. Furthermore, we introdyce the `try_sudo` and `sudo_user` constructor arguments, which can be used to force `pgsu` to try the "sudo route" for a given system user.
805b5a4
to
0bd53f4
Compare
@zhubonan does this fix things for you? |
03060f0
to
5c2493f
Compare
Codecov Report
@@ Coverage Diff @@
## master #25 +/- ##
==========================================
+ Coverage 95.70% 95.83% +0.12%
==========================================
Files 2 2
Lines 163 168 +5
==========================================
+ Hits 156 161 +5
Misses 7 7
Continue to review full report at Codecov.
|
Yeah I think the code makes sense. I was a bit confused by the naming though: Why is it called I think the reason this seems weird to me is that there are lots of "unix users" on any given system (or.. well, none), but only one of them is the postgres user. |
Yeah... the potential problem with I had I guess |
Aah, yeah that makes sense.
Yeah, I think that'd make sense. The choice between |
Makes sense for me. |
pgsu 0.2.0 out on pypi |
Thanks @ltalirz! Do you think we should relax the version constraint (currently |
oops, indeed! |
fix #18
So far,
pgsu
only tried the "sudo route" when it detected that it wasrunning on Ubuntu Linux.
It was reported that this test can fail when running on Windows
Subsystem for Linux.
Furthermore, this test might be too strict and exclude other Linux
distributions with similar postgresql setup (unverified).
Here, we switch from the check of the distribution name to a check
whether the
postgres
system user exists.Furthermore, we introdyce the
try_sudo
andsudo_user
constructorarguments, which can be used to force
pgsu
to try the "sudo route" fora given system user.