summaryrefslogtreecommitdiffstats
path: root/ipapython/ipaldap.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-03-07 11:21:05 +0100
committerMartin Kosek <mkosek@redhat.com>2013-10-31 18:09:52 +0100
commit941e9686a379aea56900d8e3194cef231c4e1406 (patch)
treef0c39e64405b1e2041975489c65e018b1046824f /ipapython/ipaldap.py
parente60eda3b3d2bbb4b23d22bcddd2e7c0dc023a7d5 (diff)
downloadfreeipa-941e9686a379aea56900d8e3194cef231c4e1406.tar.gz
freeipa-941e9686a379aea56900d8e3194cef231c4e1406.tar.xz
freeipa-941e9686a379aea56900d8e3194cef231c4e1406.zip
Use encoded values from entry objects directly when adding new entries.
https://fedorahosted.org/freeipa/ticket/3521
Diffstat (limited to 'ipapython/ipaldap.py')
-rw-r--r--ipapython/ipaldap.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index d1a02bbd0..b54299a23 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -1685,9 +1685,6 @@ class LDAPClient(object):
else:
assert isinstance(entry_or_dn, DN)
entry_attrs = self.make_entry(entry_or_dn, entry_attrs)
- for key, value in entry_attrs.items():
- if value is None:
- entry_attrs[key] = []
return entry_or_dn, entry_attrs
def add_entry(self, entry, entry_attrs=None):
@@ -1701,10 +1698,7 @@ class LDAPClient(object):
dn, attrs = self._get_dn_and_attrs(entry, entry_attrs)
# remove all [] values (python-ldap hates 'em)
- attrs = dict((k, v) for k, v in attrs.iteritems()
- # FIXME: Once entry values are always lists, this condition can
- # be just "if v":
- if v is not None and v != [])
+ attrs = dict((k, v) for k, v in attrs.raw.iteritems() if v)
with self.error_handler():
self.conn.add_s(dn, attrs.items())