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:
Christian Heimes
2017-12-04 17:29:05 +01:00
parent 01bfe2247e
commit c1f275f9eb
9 changed files with 40 additions and 43 deletions

View File

@@ -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