From 03de1b89ca4be1c178ef044a912a30c4626a9917 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 29 Oct 2010 11:32:03 -0400 Subject: Implement nested netgroups and include summaries for the commands. Replace the existing netgroup test cases with Declarative tests. This triples the number of tests we were doing. ticket 209 --- ipalib/plugins/baseldap.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'ipalib/plugins/baseldap.py') diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index f3aa09d3..97a02946 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -199,14 +199,17 @@ class LDAPObject(Object): return parent_dn def get_primary_key_from_dn(self, dn): - if self.rdn_attribute: - (dn, entry_attrs) = self.backend.get_entry( - dn, [self.primary_key.name] - ) - try: - return entry_attrs[pkey][0] - except (KeyError, IndexError): - return '' + try: + if self.rdn_attribute: + (dn, entry_attrs) = self.backend.get_entry( + dn, [self.primary_key.name] + ) + try: + return entry_attrs[self.primary_key.name][0] + except (KeyError, IndexError): + return '' + except errors.NotFound: + pass return dn[len(self.primary_key.name) + 1:dn.find(',')] def get_ancestor_primary_keys(self): -- cgit