Monday, May 22, 2017

[389-commits] [lib389] 01/01: Ticket 28 - userAccount for older versions without nsmemberof

This is an automated email from the git hooks/post-receive script.

firstyear pushed a commit to branch master
in repository lib389.

commit 05c5c22f68fe423bde9418676941aa81786a2148
Author: William Brown <firstyear@redhat.com>
Date: Mon May 15 09:19:27 2017 +1000

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: spichugi, mreynolds (Thanks)
---
lib389/idm/group.py | 6 +++++-
lib389/idm/posixgroup.py | 3 +++
lib389/idm/user.py | 6 +++++-
3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/lib389/idm/group.py b/lib389/idm/group.py
index df123aa..bcb15ed 100644
--- a/lib389/idm/group.py
+++ b/lib389/idm/group.py
@@ -7,6 +7,7 @@
# --- END COPYRIGHT BLOCK ---

from lib389._mapped_object import DSLdapObject, DSLdapObjects
+from lib389.utils import ds_is_older

MUST_ATTRIBUTES = [
'cn',
@@ -22,8 +23,9 @@ class Group(DSLdapObject):
self._create_objectclasses = [
'top',
'groupOfNames',
- 'nsMemberOf',
]
+ if not ds_is_older('1.3.7'):
+ self._create_objectclasses.append('nsMemberOf')
self._protected = False

def is_member(self, dn):
@@ -57,6 +59,8 @@ class UniqueGroup(DSLdapObject):
'top',
'groupOfUniqueNames',
]
+ if not ds_is_older('1.3.7'):
+ self._create_objectclasses.append('nsMemberOf')
self._protected = False

def is_member(self, dn):
diff --git a/lib389/idm/posixgroup.py b/lib389/idm/posixgroup.py
index c3ad1c2..8605f63 100644
--- a/lib389/idm/posixgroup.py
+++ b/lib389/idm/posixgroup.py
@@ -7,6 +7,7 @@
# --- END COPYRIGHT BLOCK ---

from lib389._mapped_object import DSLdapObject, DSLdapObjects
+from lib389.utils import ds_is_older

MUST_ATTRIBUTES = [
'cn',
@@ -25,6 +26,8 @@ class PosixGroup(DSLdapObject):
'groupOfNames',
'posixGroup',
]
+ if not ds_is_older('1.3.7'):
+ self._create_objectclasses.append('nsMemberOf')
self._protected = False

def check_member(self, dn):
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',

--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org

No comments:

Post a Comment