summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipaldap.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index 339da25ce..1d392497f 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -1768,6 +1768,12 @@ class LDAPClient(object):
if not force_replace:
modlist.append((ldap.MOD_DELETE, k, rems))
+ # Usually the modlist order does not matter.
+ # However, for schema updates, we want 'attributetypes' before
+ # 'objectclasses'.
+ # A simple sort will ensure this.
+ modlist.sort(key=lambda m: m[1].lower())
+
return modlist
def update_entry(self, entry, entry_attrs=None):