Skip to content

avoid dependency on ldap by optionally faking the exceptions - #13

Open
graingert wants to merge 1 commit into
zulip:mainfrom
graingert:no-ldap-dep
Open

avoid dependency on ldap by optionally faking the exceptions#13
graingert wants to merge 1 commit into
zulip:mainfrom
graingert:no-ldap-dep

Conversation

@graingert

Copy link
Copy Markdown

No description provided.

@graingert

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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

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

Comment thread fakeldap.py
class LDAPError(Exception): pass
class INVALID_CREDENTIALS(LDAPError): pass
class NO_SUCH_OBJECT(LDAPError): pass
class ALREADY_EXISTS(LDAPError): pass

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@timabbott

Copy link
Copy Markdown
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