User life cycle: allows MODRDN from ldap2

enhance update_entry_rdn so that is allows
to move an entry a new superior

https://fedorahosted.org/freeipa/ticket/3813

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Thierry Bordaz authored and Jan Cholasta committed 2015-04-16 06:50:16 +00:00
1 parent 1bd099a114
commit c20009123f
2 files changed
+28 -9

No files matched your search

+5 -3
View File
@@ -1417,10 +1417,12 @@ class LDAPUpdate(LDAPQuery, crud.Update):
if self.obj.rdn_is_primary_key and self.obj.primary_key.name in entry_attrs:
try:
# RDN change
self._exc_wrapper(keys, options, ldap.update_entry_rdn)(
new_dn = DN((self.obj.primary_key.name,
entry_attrs[self.obj.primary_key.name]),
*entry_attrs.dn[1:])
self._exc_wrapper(keys, options, ldap.move_entry)(
entry_attrs.dn,
RDN((self.obj.primary_key.name,
entry_attrs[self.obj.primary_key.name])))
new_dn)
rdnkeys = keys[:-1] + (entry_attrs[self.obj.primary_key.name], )
entry_attrs.dn = self.obj.get_dn(*rdnkeys)