On Fri, 2012-02-03 at 16:07 +0100, Martin Kosek wrote:
> On Fri, 2012-02-03 at 09:55 -0500, Rob Crittenden wrote:
> > Martin Kosek wrote:
> > > These two situations in netgroup-add need to be distinguished:
> > >   1) Netgroup cannot be added because a hostgroup with the same name
> > >      created a colliding managed netgroup
> > >   2) Another native netgroup with the same name exists
> > >
> > > This patch checks the colliding netgroup and raise appropriate
> > > error message based on this finding.
> > >
> > > https://fedorahosted.org/freeipa/ticket/2069
> > 
> > ACK
> 
> Pushed to master, ipa-2-2.
> 
> Martin

I didn't notice that the DN returned in netgroup-add was changed. This
confused our netgroup unit tests. Fixed and pushed as a one-liner
(attached).

Martin
>From 4ed844aeea42a33b3936846f84539bb881c47ded Mon Sep 17 00:00:00 2001
From: Martin Kosek <mko...@redhat.com>
Date: Mon, 6 Feb 2012 13:47:39 +0100
Subject: [PATCH] Return proper DN in netgroup-add

This patch fixes netgroup unit test failures which expect the
original DN.

https://fedorahosted.org/freeipa/ticket/2069
---
 ipalib/plugins/netgroup.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipalib/plugins/netgroup.py b/ipalib/plugins/netgroup.py
index 149936dc4fc09ac7a796c8c55bed6caaf23abb76..489bdb02d58105d47ae5dc6449d17dfa7826364f 100644
--- a/ipalib/plugins/netgroup.py
+++ b/ipalib/plugins/netgroup.py
@@ -151,8 +151,8 @@ class netgroup_add(LDAPCreate):
         entry_attrs.setdefault('nisdomainname', self.api.env.domain)
 
         try:
-            dn = self.obj.get_dn(keys[-1])
-            (dn_, netgroup) = ldap.get_entry(dn, ['objectclass'])
+            test_dn = self.obj.get_dn(keys[-1])
+            (test_dn_, netgroup) = ldap.get_entry(test_dn, ['objectclass'])
             if 'mepManagedEntry' in netgroup.get('objectclass', []):
                 raise errors.DuplicateEntry(message=unicode(self.msg_collision % keys[-1]))
             else:
-- 
1.7.7.6

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

Reply via email to