mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 23:50:03 -06:00
Make ldap2.add_entry proof to None values, because python-ldap hate'em.
This commit is contained in:
parent
391b1f2b88
commit
356375ef18
@ -314,6 +314,10 @@ class ldap2(CrudBackend, Encoder):
|
||||
def add_entry(self, dn, entry_attrs):
|
||||
"""Create a new entry."""
|
||||
dn = self.normalize_dn(dn)
|
||||
# remove all None values, python-ldap hates'em
|
||||
entry_attrs = dict(
|
||||
(k, v) for (k, v) in entry_attrs.iteritems() if v is not None
|
||||
)
|
||||
try:
|
||||
self.conn.add_s(dn, list(entry_attrs.iteritems()))
|
||||
except _ldap.LDAPError, e:
|
||||
|
Loading…
Reference in New Issue
Block a user