From 03731660020425879607e7acf4a57e84f757ca0a Mon Sep 17 00:00:00 2001 From: Pavel Zuna Date: Tue, 6 Oct 2009 15:50:43 +0200 Subject: Fix bug in HBAC and netgroup plugin get_primary_key_from_dn methods. --- ipalib/plugins/netgroup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ipalib/plugins/netgroup.py') diff --git a/ipalib/plugins/netgroup.py b/ipalib/plugins/netgroup.py index 21e6986d..c3543238 100644 --- a/ipalib/plugins/netgroup.py +++ b/ipalib/plugins/netgroup.py @@ -81,7 +81,10 @@ class netgroup(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(netgroup) -- cgit