diff options
author | Rob Crittenden <rcritten@redhat.com> | 2011-04-05 16:28:59 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-04-05 21:46:32 -0400 |
commit | b9a2c11d6f6be6e7e599a48c70e798b720222b35 (patch) | |
tree | 3f49173bcc53d76bdedd545b0ecd6ba2539f5cf5 /ipaserver/ipaldap.py | |
parent | 86995509a1d29497fb1c95f810337a567e1d5634 (diff) | |
download | freeipa-b9a2c11d6f6be6e7e599a48c70e798b720222b35.tar.gz freeipa-b9a2c11d6f6be6e7e599a48c70e798b720222b35.tar.xz freeipa-b9a2c11d6f6be6e7e599a48c70e798b720222b35.zip |
Fix ORDERING in some attributetypes and remove other unnecessary elements.
Looking at the schema in 60basev2.ldif there were many attributes that did
not have an ORDERING matching rule specified correctly. There were also a
number of attributeTypes that should have been just SUP
distinguishedName that had a combination of SUP, SYNTAX, ORDERING, etc.
This requires 389-ds-base-1.2.8.0-1+
ticket 1153
Diffstat (limited to 'ipaserver/ipaldap.py')
-rw-r--r-- | ipaserver/ipaldap.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py index b72a43ee3..b933839ab 100644 --- a/ipaserver/ipaldap.py +++ b/ipaserver/ipaldap.py @@ -523,10 +523,16 @@ class IPAdmin(SimpleLDAPObject): adds = list(new_values.difference(old_values)) removes = list(old_values.difference(new_values)) - if len(removes) > 0: - modlist.append((ldap.MOD_DELETE, key, removes)) - if len(adds) > 0: - modlist.append((ldap.MOD_ADD, key, adds)) + # You can't remove schema online. An add will automatically + # replace any existing schema. + if old_entry.get('dn') == 'cn=schema': + if len(adds) > 0: + modlist.append((ldap.MOD_ADD, key, adds)) + else: + if len(removes) > 0: + modlist.append((ldap.MOD_DELETE, key, removes)) + if len(adds) > 0: + modlist.append((ldap.MOD_ADD, key, adds)) return modlist |