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

avoid dependency on ldap by optionally faking the exceptions #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

graingert
Copy link

No description provided.

@graingert
Copy link
Author

@eeshangarg we currently use python-ldap~=2.4 and although we are looking to upgrade we're not yet ready to do so. When installing this testing package we are forced to upgrade to python-ldap~=3.0 which conflicts

@graingert
Copy link
Author

this also allows people to test without having python-ldap installed at all:

import sys
import fakeldap

sys.modules['ldap'] = fakeldap.ldap

@eeshangarg
Copy link
Member

@graingert: Thanks for working on this! Looks good to me! :)

@timabbott: Could you please take a quick look as well? Thanks!

class LDAPError(Exception): pass
class INVALID_CREDENTIALS(LDAPError): pass
class NO_SUCH_OBJECT(LDAPError): pass
class ALREADY_EXISTS(LDAPError): pass
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment here explaining the motivation from the PR description? I think it'll be helpful for future folks reading the code to not need to spelink.

@timabbott
Copy link
Member

Makes sense to me; posted a quick comment on documentation.

@timabbott
Copy link
Member

Possibly we should also add a brief section at the bottom of the README mentioning this behavior, maybe with a title like "Usage without ldap installed".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants