summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2010-11-08 22:36:04 -0500
committerAdam Young <ayoung@redhat.com>2010-11-24 09:54:01 -0500
commita34bb67cbd7e1e860e856bcf53bef764d9b1c9d9 (patch)
tree7c08b4d757c3c0d67e0ba31c84b6532be7776eae /ipalib
parent8d235c6b7134d54acee315a50a53d0d741173b64 (diff)
downloadfreeipa-a34bb67cbd7e1e860e856bcf53bef764d9b1c9d9.tar.gz
freeipa-a34bb67cbd7e1e860e856bcf53bef764d9b1c9d9.tar.xz
freeipa-a34bb67cbd7e1e860e856bcf53bef764d9b1c9d9.zip
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.
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/baseldap.py6
1 files changed, 5 insertions, 1 deletions
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)