From a34bb67cbd7e1e860e856bcf53bef764d9b1c9d9 Mon Sep 17 00:00:00 2001 From: Pavel Zuna Date: Mon, 8 Nov 2010 22:36:04 -0500 Subject: Rename parent LDAPObject pkeys in child LDAPObject methods. If the parent and child entries have the same attribute as primary key (such as in the DNS schema), we need to rename the parent key to prevent a param name conflict. It has no side effects, because the primary key name is always taken from the LDAPObject params, never from the method params. --- ipalib/plugins/baseldap.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipalib') diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index dfde0a211..a67b84d09 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -232,7 +232,11 @@ class LDAPObject(Object): for key in parent_obj.get_ancestor_primary_keys(): yield key if parent_obj.primary_key: - yield parent_obj.primary_key.clone(query=True) + pkey = parent_obj.primary_key + yield pkey.__class__( + parent_obj.name + pkey.name, required=True, query=True, + cli_name=parent_obj.name, label=pkey.label + ) def has_objectclass(self, classes, objectclass): oc = map(lambda x:x.lower(),classes) -- cgit