Remove schema special-casing from the LDAP updater
Now that there's a dedicated schema updater, we do not need the code in ldapupdate. https://fedorahosted.org/freeipa/ticket/3454
This commit is contained in:
1 parent
d9a1c09e7c
commit
6381d766ce
2 files changed
+12
-130
No files matched your search
+8
-19
@@ -1963,25 +1963,14 @@ class IPAdmin(LDAPClient):
|
||||
if key in FORCE_REPLACE_ON_UPDATE_ATTRS or is_single_value:
|
||||
force_replace = True
|
||||
|
||||
# You can't remove schema online. An add will automatically
|
||||
# replace any existing schema.
|
||||
if old_entry.dn == DN(('cn', 'schema')):
|
||||
if len(adds) > 0:
|
||||
if key.lower() == 'attributetypes':
|
||||
modlist.insert(0, (ldap.MOD_ADD, key, adds))
|
||||
else:
|
||||
modlist.append((ldap.MOD_ADD, key, adds))
|
||||
else:
|
||||
if adds:
|
||||
if force_replace:
|
||||
modlist.append((ldap.MOD_REPLACE, key, adds))
|
||||
else:
|
||||
modlist.append((ldap.MOD_ADD, key, adds))
|
||||
if removes:
|
||||
if not force_replace:
|
||||
modlist.append((ldap.MOD_DELETE, key, removes))
|
||||
elif new_values == []: # delete an empty value
|
||||
modlist.append((ldap.MOD_DELETE, key, removes))
|
||||
if adds:
|
||||
if force_replace:
|
||||
modlist.append((ldap.MOD_REPLACE, key, adds))
|
||||
else:
|
||||
modlist.append((ldap.MOD_ADD, key, adds))
|
||||
if removes:
|
||||
if not force_replace or not new_values:
|
||||
modlist.append((ldap.MOD_DELETE, key, removes))
|
||||
|
||||
return modlist
|
||||
|
||||
|
||||
Reference in new issue
Block a user