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.
This commit is contained in:
Pavel Zuna
2010-11-08 22:36:04 -05:00
committed by Adam Young
parent 8d235c6b71
commit a34bb67cbd

View File

@@ -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)