summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-10-29 11:32:03 -0400
committerAdam Young <ayoung@redhat.com>2010-10-29 14:03:15 -0400
commit03de1b89ca4be1c178ef044a912a30c4626a9917 (patch)
tree0a7b0ad367a07b38a1e3b023dcb0e72ccd6ee96f /ipalib/plugins/baseldap.py
parent6df16f3a1007bb60414bda87c970a89b21713888 (diff)
downloadfreeipa-03de1b89ca4be1c178ef044a912a30c4626a9917.tar.gz
freeipa-03de1b89ca4be1c178ef044a912a30c4626a9917.tar.xz
freeipa-03de1b89ca4be1c178ef044a912a30c4626a9917.zip
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
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py19
1 files changed, 11 insertions, 8 deletions
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):