mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -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):
|
def add_entry(self, dn, entry_attrs):
|
||||||
"""Create a new entry."""
|
"""Create a new entry."""
|
||||||
dn = self.normalize_dn(dn)
|
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:
|
try:
|
||||||
self.conn.add_s(dn, list(entry_attrs.iteritems()))
|
self.conn.add_s(dn, list(entry_attrs.iteritems()))
|
||||||
except _ldap.LDAPError, e:
|
except _ldap.LDAPError, e:
|
||||||
|
Loading…
Reference in New Issue
Block a user