From 9ce77873ff7cb124bd4cfc34a736b2176b26e48f Mon Sep 17 00:00:00 2001 From: William Brown Date: Mon, 15 May 2017 09:19:27 +1000 Subject: [PATCH] Ticket 28 - userAccount for older versions without nsmemberof Bug Description: Older DS versions don't support nsmemberof Fix Description: Make a version check on the objectClass https://pagure.io/lib389/issue/28 Author: wibrown Review by: ??? --- lib389/idm/user.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib389/idm/user.py b/lib389/idm/user.py index 81f3ee0..ad1f95f 100644 --- a/lib389/idm/user.py +++ b/lib389/idm/user.py @@ -9,6 +9,7 @@ from lib389._mapped_object import DSLdapObjects # Account derives DSLdapObject - it gives us the lock / unlock functions. from lib389.idm.account import Account +from lib389.utils import ds_is_older MUST_ATTRIBUTES = [ 'uid', @@ -32,12 +33,15 @@ class UserAccount(Account): 'account', 'posixaccount', 'inetOrgPerson', - 'nsMemberOf', 'organizationalPerson', # This may not always work at sites? # Can we get this into core? # 'ldapPublicKey', ] + if ds_is_older('1.3.7'): + self._create_objectclasses.append('inetUser') + else: + self._create_objectclasses.append('nsMemberOf') user_compare_exclude = [ 'nsUniqueId', 'modifyTimestamp', -- 1.8.3.1