devpi / devpi-ldap

Plugin for devpi-server which provides LDAP authentication.
36 stars 20 forks source link

Error in extract_search #39

Closed tomasbedrich closed 6 years ago

tomasbedrich commented 6 years ago

After the last release (1.2.1) I am getting following error:

$ devpi-ldap ldap.yaml foo.bar
Password: xxx
2018-05-28 13:39:37,662 DEBUG NOCTX Validating user 'foo.bar' against LDAP at ldap://somewhere.
Traceback (most recent call last):
  File "/usr/local/bin/devpi-ldap", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/devpi_ldap/main.py", line 293, in main
    result = ldap.validate(username, password)
  File "/usr/local/lib/python3.5/dist-packages/devpi_ldap/main.py", line 241, in validate
    userdn = self._userdn(username)
  File "/usr/local/lib/python3.5/dist-packages/devpi_ldap/main.py", line 218, in _userdn
    result = self._search(None, self['user_search'], username=username)
  File "/usr/local/lib/python3.5/dist-packages/devpi_ldap/main.py", line 194, in _search
    return sum((extract_search(x) for x in conn.response), [])
TypeError: can only concatenate list (not "str") to list

After re-reverting commit 7f9a7391630e7990c217996236482ac362eb8fac (putting the braces back again), everything works fine.

fschulze commented 6 years ago

Can you please try with just release devpi-ldap 1.2.2?

tomasbedrich commented 6 years ago

Great, release 1.2.2 fixed the issue. Thanks