summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2017-02-07 14:11:24 +0100
committerMartin Basti <mbasti@redhat.com>2017-02-09 15:57:48 +0100
commite920ae22525d34e1f524e2e59159ac50c603bc8c (patch)
tree0620302ad6a11af7d8a2a67b56ebe97ed35b2309 /ipapython
parentb20f6fb29478de6b4f25741bc4fd975a5e0be671 (diff)
downloadfreeipa-e920ae22525d34e1f524e2e59159ac50c603bc8c.tar.gz
freeipa-e920ae22525d34e1f524e2e59159ac50c603bc8c.tar.xz
freeipa-e920ae22525d34e1f524e2e59159ac50c603bc8c.zip
ipaldap: preserve order of values in LDAPEntry._sync()
In Python 2, the order was preserved by accident. This change makes sure the order is preserved in both Python 2 and 3. https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipaldap.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index c811431f1..6a4674405 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -292,13 +292,13 @@ class LDAPEntry(collections.MutableMapping):
continue
nice.remove(value)
- for value in nice_adds:
+ for value in sorted(nice_adds, key=nice.index):
value = self._conn.encode(value)
if value in raw_dels:
continue
raw.append(value)
- for value in raw_adds:
+ for value in sorted(raw_adds, key=raw.index):
try:
value = self._conn.decode(value, name)
except ValueError as e: