Skip to content
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

Added a try/except for importing pam with logging an error and update… #151

Merged
merged 1 commit into from
Jun 24, 2016

Conversation

blade2005
Copy link
Contributor

…d README to note that when using pam you need to install pam module

2016-06-24 16:54:27 pypiserver._app INFO <LocalRequest: POST http://127.0.0.1:8092/>
2016-06-24 16:54:27 pypiserver.core ERROR PAM module not found. Please install pam module
2016-06-24 16:54:27 pypiserver._app INFO 200 OK

…d README to note that when using pam you need to install pam module
@blade2005
Copy link
Contributor Author

On a successful upload with pam

2016-06-24 16:55:39 pypiserver._app INFO <LocalRequest: POST http://127.0.0.1:8092/>
2016-06-24 16:55:40 pypiserver._app INFO User u'blade2005' stored 'pypiserver-1.2.0b1.zip'.
2016-06-24 16:55:40 pypiserver._app INFO 200 OK

@mplanchard
Copy link
Contributor

Test failure looks like it may have been non-deterministic. Re-running.

@blade2005
Copy link
Contributor Author

LOL. I was so very confused when I was looking at the test and the results disappeared from my screen.

@mplanchard
Copy link
Contributor

The beauty of distributed testing 🔮

@mplanchard
Copy link
Contributor

Looks like it may be a real problem

@blade2005
Copy link
Contributor Author

blade2005 commented Jun 24, 2016

o.O how does this one fail testing where the last one didn't. Looks like bad request got returned when trying to upload.

I tested it by hand and didn't see any issues.

# /usr/bin/pypi-server -r /packages -a '.' -P '.' -p 8092
removing 'pypiserver-1.2.0b1' (and everything under it)
running upload
Submitting dist/pypiserver-1.2.0b1.zip to http://127.0.0.1:8092/
Server response (200): OK

EDIT: Noticed it was failing for bdist and bdist_wheel.

running upload
Submitting /home/cdavis/pypiserver/dist/pypiserver-1.2.0b1-py2.py3-none-any.whl to http://127.0.0.1:8092/
Server response (200): OK
Submitting /home/cdavis/pypiserver/dist/pypiserver-1.2.0b1.linux-x86_64.tar.gz to http://127.0.0.1:8092/
Server response (200): OK

Still running fine. Might be something in the test env (mine or travis).

@mplanchard
Copy link
Contributor

I’ll try running them again.

On Jun 24, 2016, at 12:11 PM, Craig Davis notifications@github.com wrote:

o.O how does this one fail testing where the last one didn't. Looks like bad request got returned when trying to upload.

I tested it by hand and didn't see any issues.

/usr/bin/pypi-server -r /packages -a '.' -P '.' -p 8092

removing 'pypiserver-1.2.0b1' (and everything under it)
running upload
Submitting dist/pypiserver-1.2.0b1.zip to http://127.0.0.1:8092/
Server response (200): OK

You are receiving this because you commented.
Reply to this email directly, view it on GitHub #151 (comment), or mute the thread https://github.com/notifications/unsubscribe/AGcI4Rh8ldLrBGDMAUUrGYqGGpTlKhh-ks5qPA_KgaJpZM4I98Qs.

@mplanchard
Copy link
Contributor

Hey, there we go.

@blade2005
Copy link
Contributor Author

3rd time IS the charm then.

@mplanchard mplanchard merged commit 90b75f2 into pypiserver:master Jun 24, 2016
@blade2005 blade2005 deleted the topic/pam-auth branch June 24, 2016 17:17
@mplanchard mplanchard added this to the M1.2.0 milestone Jun 24, 2016
return pam.authenticate(username, password)
except ImportError as error:
log.error('PAM module not found. Please install pam module')
return False

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry :-(
We don't try/catch for missing dependencies - the original exception is quite explanatory to the user (in combination with the documentation, which is the one needing improvement).

@mplanchard
Copy link
Contributor

Huh. I didn't know that. Want to pull it out?

@ankostis
Copy link
Member

ankostis commented Jun 24, 2016

Yes, lets keep the code under diet :-) thanks!

[edit:] To be consistent, we would have to do the same also for passlib.apache - but we don't.

@mplanchard
Copy link
Contributor

I'll have a PR up for that shortly

@mplanchard
Copy link
Contributor

See #152

@ankostis
Copy link
Member

@mplanchard please wait.
This PR is practically 2 lines of code + documentation:

import pam
..., auther=pam.authenticate)

why don't we keep everything to the documentation, and leave the new code for a future release, when updating the main() flags?

@mplanchard
Copy link
Contributor

You mean the pam import in general? I suppose we could pull it out entirely and push it to the next release. Seemed like a pretty easy include with docs, though. Whatever you think is best.

@blade2005 blade2005 restored the topic/pam-auth branch June 24, 2016 18:24
@ankostis
Copy link
Member

ankostis commented Jun 24, 2016

Commented in #152 what i suggest.

michaelkuty pushed a commit to michaelkuty/pypiserver that referenced this pull request Jun 27, 2016
Added a try/except for importing pam with logging an error and update…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants