-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When performing an RDN change, we would construct the new DN from the
RDN attribute only. This doesn't work when the object needs has a parent.

There's currently no testcase, I hit that when working on automount - so
this patch will be testable with the automount patch and also a
dependency for it. But I think the code is pretty clear..

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk0PSNwACgkQHsardTLnvCWVNwCg2R+eiK2KoM6GlIuSrsYJZKzw
zOcAnihrRg63h72zzhCzjg4WjPeuguP/
=SNXO
-----END PGP SIGNATURE-----
From d6520b9d391a1541d18b73bd00a5a05a304f667e Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Wed, 15 Dec 2010 10:07:46 +0100
Subject: [PATCH] Allow renaming of object that have a parent

Allow renaming of object that have a parent
---
 ipalib/plugins/baseldap.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 9ef5f37..69682dc 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -772,7 +772,8 @@ class LDAPUpdate(LDAPQuery, crud.Update):
                 # RDN change
                 ldap.update_entry_rdn(dn, unicode('%s=%s' % (self.obj.rdnattr,
                     entry_attrs[self.obj.rdnattr])))
-                dn = self.obj.get_dn(entry_attrs[self.obj.rdnattr])
+                rdnkeys = keys[:-1] + (entry_attrs[self.obj.rdnattr], )
+                dn = self.obj.get_dn(*rdnkeys)
                 del entry_attrs[self.obj.rdnattr]
                 options['rdnupdate'] = True
                 rdnupdate = True
-- 
1.7.3.3

Attachment: freeipa-jhrozek-027-rename-with-parent.patch.sig
Description: PGP signature

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to