diff options
author | Pavel Zuna <pzuna@redhat.com> | 2009-08-28 18:22:32 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-09-08 13:38:25 -0400 |
commit | 356375ef1893b8cc9004c05f5af5302ec198a25e (patch) | |
tree | bab6b259ad336327adef4e4e916683f5d826dbf6 /ipaserver | |
parent | 391b1f2b88264ae435735ebd141457b5d35de5c6 (diff) | |
download | freeipa-356375ef1893b8cc9004c05f5af5302ec198a25e.tar.gz freeipa-356375ef1893b8cc9004c05f5af5302ec198a25e.tar.xz freeipa-356375ef1893b8cc9004c05f5af5302ec198a25e.zip |
Make ldap2.add_entry proof to None values, because python-ldap hate'em.
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/plugins/ldap2.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py index f2eef9d3..639552b2 100644 --- a/ipaserver/plugins/ldap2.py +++ b/ipaserver/plugins/ldap2.py @@ -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: |