Add LDAPObject setting to handle different attributes for RDN and PKEY.

This commit is contained in:
Pavel Zuna authored and Simo Sorce committed 2010-10-28 07:58:31 -04:00
1 parent c51ce61e4d
commit 93290c8a72
4 files changed
+48 -64

No files matched your search

+1 -10
View File
@@ -38,6 +38,7 @@ class sudorule(LDAPObject):
]
uuid_attribute = 'ipauniqueid'
rdn_attribute = 'ipauniqueid'
attribute_members = {
'memberuser': ['user', 'group'],
'memberhost': ['host', 'hostgroup'],
@@ -88,16 +89,6 @@ class sudorule(LDAPObject):
)
def get_dn(self, *keys, **kwargs):
try:
(dn, entry_attrs) = self.backend.find_entry_by_attr(
self.primary_key.name, keys[-1], self.object_class, [''],
self.container_dn
)
except errors.NotFound:
dn = super(sudorule, self).get_dn(*keys, **kwargs)
return dn
api.register(sudorule)