From e3f4456d9275d38c8418e568706dba9d572e54bf Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Feb 26 2018 16:26:49 +0000 Subject: intg: Fix python2,3 urllib The three modules urllib, urllib2 and urlparse has been reorganized into three new modules, urllib.request, urllib.parse and urllib.error. And urllib.quote was moved into urllib.parse. Reviewed-by: Martin Basti (cherry picked from commit c46dec3dfad9e83321cc9d3185d93f0e8c38f57e) --- diff --git a/src/tests/intg/ds_openldap.py b/src/tests/intg/ds_openldap.py index fb230a0..c6bb7f2 100644 --- a/src/tests/intg/ds_openldap.py +++ b/src/tests/intg/ds_openldap.py @@ -19,7 +19,6 @@ import hashlib import base64 -import urllib import time import ldap import os @@ -30,6 +29,11 @@ import sys from util import * from ds import DS +try: + from urllib import quote as url_quote +except ImportError: + from urllib.parse import quote as url_quote + def hash_password(password): """Generate userPassword value for a password.""" @@ -183,7 +187,7 @@ class DSOpenLDAP(DS): def setup(self): """Setup the instance.""" ldapi_socket = self.run_dir + "/ldapi" - ldapi_url = "ldapi://" + urllib.quote(ldapi_socket, "") + ldapi_url = "ldapi://" + url_quote(ldapi_socket, "") url_list = ldapi_url + " " + self.ldap_url os.makedirs(self.conf_slapd_d_dir)