summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-04-26 15:38:38 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-11-18 16:54:21 +0100
commit6381d766ceeebdb8ba8e83539a90167d86c7f3ce (patch)
treefd82a0ab16a95cdddbdcd03a6f4073e05c7007fa /ipapython
parentd9a1c09e7c70af697676449dab6737da0a392f66 (diff)
downloadfreeipa-6381d766ceeebdb8ba8e83539a90167d86c7f3ce.tar.gz
freeipa-6381d766ceeebdb8ba8e83539a90167d86c7f3ce.tar.xz
freeipa-6381d766ceeebdb8ba8e83539a90167d86c7f3ce.zip
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
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipaldap.py27
1 files changed, 8 insertions, 19 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index 1d392497f..027bfa979 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -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