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

Installing python-ldap first causes mismatch between wrapper script and lib #31

Open
n2taylor opened this issue Nov 22, 2017 · 1 comment

Comments

@n2taylor
Copy link

If you install the python-ldap library globally with pip before installing ssh-ldap-pubkey, the ssh-ldap-pubkey-wrapper script will import the python-ldap module at the top level, but it will attempt to use the version installed by pyldap. This leads to errors when the two libraries drift.

We experienced an issue the other day due to the mismatch in an __init__ function between python-ldap (2.5.2) and pyldap (2.4.45):

$ /usr/local/bin/ssh-ldap-pubkey-wrapper test.user
Traceback (most recent call last):
  File "/usr/local/bin/ssh-ldap-pubkey", line 144, in <module>
    main(**kwargs)
  File "/usr/local/bin/ssh-ldap-pubkey", line 108, in main
    ldapssh.connect()
  File "/usr/local/lib/python2.7/dist-packages/ssh_ldap_pubkey/__init__.py", line 101, in connect
    self._conn = conn = ldap.initialize(' '.join(conf.uris))
  File "/usr/local/lib/python2.7/dist-packages/ldap/functions.py", line 94, in initialize
    return LDAPObject(uri,trace_level,trace_file,trace_stack_limit,bytes_mode)
TypeError: __init__() takes at most 5 arguments (6 given)

I'm not sure what the correct fix is here, just passing it along.

@robbat2
Copy link
Contributor

robbat2 commented Nov 18, 2018

@n2taylor newer pyldap just brings in python-ldap-3 directly, and doesn't leave anything else behind to drift.

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

No branches or pull requests

2 participants