Re: [Freeipa-devel] [PATCH] Rename parent LDAPObject pkeys in child LDAPObject methods.

2010-11-24 Thread Adam Young

On 11/24/2010 03:48 AM, Pavel Zuna wrote:

On 11/19/2010 04:23 PM, Jakub Hrozek wrote:

On Tue, Nov 09, 2010 at 04:55:50AM +0100, Pavel Zůna wrote:

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.

Pavel


Would you mind rebasing the patch on top of Rob's 593 which is already
acked (not pushed yet as of now).

 Jakub



Rebased patch number 35 attached - required by the new DNS plugin.

Pavel


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

ACK and pushed to master
___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] [PATCH] Rename parent LDAPObject pkeys in child LDAPObject methods.

2010-11-24 Thread Pavel Zuna

On 11/19/2010 04:23 PM, Jakub Hrozek wrote:

On Tue, Nov 09, 2010 at 04:55:50AM +0100, Pavel Zůna wrote:

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.

Pavel


Would you mind rebasing the patch on top of Rob's 593 which is already
acked (not pushed yet as of now).

 Jakub



Rebased patch number 35 attached - required by the new DNS plugin.

Pavel
>From 6325523e8b01fe64ff24dbc1cd2fcb62038a56e3 Mon Sep 17 00:00:00 2001
From: Pavel Zuna 
Date: Mon, 8 Nov 2010 22:36:04 -0500
Subject: [PATCH] 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 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 8f723b9..7039f1c 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)
-- 
1.7.1.1

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

Re: [Freeipa-devel] [PATCH] Rename parent LDAPObject pkeys in child LDAPObject methods.

2010-11-19 Thread Jakub Hrozek
On Tue, Nov 09, 2010 at 04:55:50AM +0100, Pavel Zůna wrote:
> 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.
> 
> Pavel

Would you mind rebasing the patch on top of Rob's 593 which is already
acked (not pushed yet as of now).

Jakub

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