diff options
Diffstat (limited to 'ipalib/plugins/netgroup.py')
-rw-r--r-- | ipalib/plugins/netgroup.py | 5 |
1 files changed, 4 insertions, 1 deletions
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) |