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

@@ -29,6 +29,7 @@ import contextlib
import collections
import os
import pwd
import warnings
# pylint: disable=import-error
from six.moves.urllib.parse import urlparse
@@ -76,6 +77,20 @@ TRUNCATED_ADMIN_LIMIT = object()
DIRMAN_DN = DN(('cn', 'directory manager'))
if six.PY2:
# XXX silence python-ldap's BytesWarnings
warnings.filterwarnings(
action="ignore",
message="Under Python 2, python-ldap uses bytes",
category=BytesWarning
)
warnings.filterwarnings(
action="ignore",
message="Received non-bytes value",
category=BytesWarning
)
class _ServerSchema(object):
'''
Properties of a schema retrieved from an LDAP server.