diff options
| author | Jan Cholasta <jcholast@redhat.com> | 2017-02-07 14:11:24 +0100 |
|---|---|---|
| committer | Martin Basti <mbasti@redhat.com> | 2017-02-09 15:57:48 +0100 |
| commit | e920ae22525d34e1f524e2e59159ac50c603bc8c (patch) | |
| tree | 0620302ad6a11af7d8a2a67b56ebe97ed35b2309 /ipapython | |
| parent | b20f6fb29478de6b4f25741bc4fd975a5e0be671 (diff) | |
| download | freeipa-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.py | 4 |
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: |
