summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2014-02-04 11:39:35 +0100
committerPetr Viktorin <pviktori@redhat.com>2014-03-03 12:14:09 +0100
commitc0c38ed3143963ae3308423294c53454d901a716 (patch)
tree6067ab30f5677567f1bec0fe4cdba41956e269f4 /ipapython
parente99fa380af7f257a319cbe6f8867bf258ab04e41 (diff)
downloadfreeipa-c0c38ed3143963ae3308423294c53454d901a716.tar.gz
freeipa-c0c38ed3143963ae3308423294c53454d901a716.tar.xz
freeipa-c0c38ed3143963ae3308423294c53454d901a716.zip
Fix modlist generation code not to generate empty replace mods.
https://fedorahosted.org/freeipa/ticket/4138 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipaldap.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index 074e0c219..699bf70c6 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -978,12 +978,12 @@ class LDAPEntry(collections.MutableMapping):
names = set(self.iterkeys())
names.update(self._orig)
for name in names:
- new = self.raw.get(name)
- old = self._orig.get(name)
+ new = self.raw.get(name, [])
+ old = self._orig.get(name, [])
if old and not new:
modlist.append((ldap.MOD_DELETE, name, None))
continue
- if not old:
+ if not old and new:
modlist.append((ldap.MOD_REPLACE, name, new))
continue