[python-ldap] Modifying user attributes
Ziad Badawi
ziadbad at gmail.com
Tue Feb 24 16:03:11 CET 2015
Hello,
I am trying to modify the telephoneNumber user attribute as follows
#!/usr/bin/python
import ldap
import ldap.modlist as modlist
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
l = ldap.initialize('ldaps://domain.local:636')
l.simple_bind_s('user', 'passwd')
dn="CN=John Smith,OU=Domain Users,DC=domain,DC=local"
old = {'telephoneNumber': '1234'}
new = {'telephoneNumber':'123456'}
ldif = modlist.modifyModlist(old,new)
l.modify_s(dn,ldif)
l.unbind_s()
When I execute this, I get
ldap.SERVER_DOWN: {'info': 'TLS error -5939:No more entries in the
directory', 'desc': "Can't contact LDAP server"}
and I am not sure what it means, but the strange thing is when I execute
this another time, it works fine and the attribute is modified
Any idea what is going on here? and what is the solution?
--
Z
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20150224/8f88bec8/attachment.html>
More information about the python-ldap
mailing list