mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Update to python-ldap 3.0.0
Replace python3-pyldap with python3-ldap. Remove some old code for compatibility with very old python-ldap. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
@@ -38,20 +38,7 @@ from ipapython.dn import DN
|
||||
from ipapython.ipaldap import (LDAPClient, AUTOBIND_AUTO, AUTOBIND_ENABLED,
|
||||
AUTOBIND_DISABLED)
|
||||
|
||||
|
||||
try:
|
||||
from ldap.controls.simple import GetEffectiveRightsControl
|
||||
except ImportError:
|
||||
"""
|
||||
python-ldap 2.4.x introduced a new API for effective rights control, which
|
||||
needs to be used or otherwise bind dn is not passed correctly. The following
|
||||
class is created for backward compatibility with python-ldap 2.3.x.
|
||||
Relevant BZ: https://bugzilla.redhat.com/show_bug.cgi?id=802675
|
||||
"""
|
||||
from ldap.controls import LDAPControl
|
||||
class GetEffectiveRightsControl(LDAPControl):
|
||||
def __init__(self, criticality, authzId=None):
|
||||
LDAPControl.__init__(self, '1.3.6.1.4.1.42.2.27.9.5.2', criticality, authzId)
|
||||
from ldap.controls.simple import GetEffectiveRightsControl
|
||||
|
||||
from ipalib import Registry, errors, _
|
||||
from ipalib.crud import CrudBackend
|
||||
|
||||
Reference in New Issue
Block a user