summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/hbac.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2009-10-06 15:50:43 +0200
committerRob Crittenden <rcritten@redhat.com>2009-10-08 10:11:29 -0400
commit03731660020425879607e7acf4a57e84f757ca0a (patch)
treea981bf864720eb01cf3743e0c175c51926ffa031 /ipalib/plugins/hbac.py
parent0dd92f10cc9313f4126fc74efcb6be3e6273915e (diff)
downloadfreeipa-03731660020425879607e7acf4a57e84f757ca0a.tar.gz
freeipa-03731660020425879607e7acf4a57e84f757ca0a.tar.xz
freeipa-03731660020425879607e7acf4a57e84f757ca0a.zip
Fix bug in HBAC and netgroup plugin get_primary_key_from_dn methods.
Diffstat (limited to 'ipalib/plugins/hbac.py')
-rw-r--r--ipalib/plugins/hbac.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipalib/plugins/hbac.py b/ipalib/plugins/hbac.py
index 16a93d28c..6fd2f912e 100644
--- a/ipalib/plugins/hbac.py
+++ b/ipalib/plugins/hbac.py
@@ -96,7 +96,10 @@ class hbac(LDAPObject):
def get_primary_key_from_dn(self, dn):
pkey = self.primary_key.name
(dn, entry_attrs) = self.backend.get_entry(dn, [pkey])
- return entry_attrs.get(pkey, '')
+ try:
+ return entry_attrs[pkey][0]
+ except (KeyError, IndexError):
+ return ''
api.register(hbac)