summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/hbac.py
diff options
context:
space:
mode:
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)