Added a try/except for importing pam with logging an error and updated README to note that when using pam you need to install pam module
This commit is contained in:
parent
0bf002437f
commit
a10c60aa91
|
@ -111,7 +111,8 @@ Currently only password-protected uploads are supported!
|
|||
bottle.run(app=app, host=config.host, port=config.port, server=config.server)
|
||||
|
||||
.. Note::
|
||||
If you are getting authentication even with incorrect credentials please check your PAM configuration.
|
||||
- If you are getting authentication even with incorrect credentials please check your PAM configuration.
|
||||
- This requires installing pam module `pip install pam`
|
||||
|
||||
#. On client-side, edit or create a `~/.pypirc` file with a similar content::
|
||||
|
||||
|
|
|
@ -92,8 +92,12 @@ def auth_by_htpasswd_file(htPsswdFile, username, password):
|
|||
|
||||
|
||||
def auth_by_pam(username, password):
|
||||
import pam
|
||||
return pam.authenticate(username, password)
|
||||
try:
|
||||
import pam
|
||||
return pam.authenticate(username, password)
|
||||
except ImportError as error:
|
||||
log.error('PAM module not found. Please install pam module')
|
||||
return False
|
||||
|
||||
|
||||
mimetypes.add_type("application/octet-stream", ".egg")
|
||||
|
|
Loading…
Reference in New Issue