mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use six.moves.urllib instead of urllib/urllib2/urlparse
In Python 3, these modules are reorganized. Reviewed-By: David Kupka <dkupka@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
7f1204a42c
commit
70b37a956c
@@ -20,9 +20,10 @@
|
||||
Base class for HTTP request tests
|
||||
"""
|
||||
|
||||
import urllib
|
||||
import httplib
|
||||
|
||||
from six.moves import urllib
|
||||
|
||||
from ipalib import api
|
||||
|
||||
class Unauthorized_HTTP_test(object):
|
||||
@@ -41,7 +42,9 @@ class Unauthorized_HTTP_test(object):
|
||||
:param key When not None, overrides default app_uri
|
||||
"""
|
||||
if params is not None:
|
||||
params = urllib.urlencode(params, True)
|
||||
# urlencode *can* take two arguments
|
||||
# pylint: disable=too-many-function-args
|
||||
params = urllib.parse.urlencode(params, True)
|
||||
url = 'https://' + self.host + self.app_uri
|
||||
|
||||
headers = {'Content-Type' : self.content_type,
|
||||
|
||||
@@ -53,7 +53,7 @@ try:
|
||||
NO_YAML = False
|
||||
except ImportError:
|
||||
NO_YAML = True
|
||||
from urllib2 import URLError
|
||||
from six.moves.urllib.error import URLError
|
||||
from ipaplatform.paths import paths
|
||||
|
||||
ENV_MAP = {
|
||||
|
||||
Reference in New Issue
Block a user