summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-04-26 15:21:35 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-11-18 16:54:21 +0100
commitf52d471aa7d9dfbb1553bcf58e1279459bc6986b (patch)
tree7c1f9a8f05ff61bcd7663d499fdc250128e98eee /ipapython
parent9e79d2bc5e85874ebb90f97e1660d160a65ebddb (diff)
downloadfreeipa-f52d471aa7d9dfbb1553bcf58e1279459bc6986b.tar.gz
freeipa-f52d471aa7d9dfbb1553bcf58e1279459bc6986b.tar.xz
freeipa-f52d471aa7d9dfbb1553bcf58e1279459bc6986b.zip
Add schema updater based on IPA schema files
The new updater is run as part of `ipa-ldap-updater --upgrade` and `ipa-ldap-updater --schema` (--schema is a new option). The --schema-file option to ipa-ldap-updater may be used (multiple times) to select a non-default set of schema files to update against. The updater adds an X-ORIGIN tag with the current IPA version to all elements it adds or modifies. https://fedorahosted.org/freeipa/ticket/3454
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):