From 48cc60b11cf944db37169c5221fc087101ab0ff3 Mon Sep 17 00:00:00 2001 From: Yoshito Komatsu Date: Thu, 30 Apr 2015 22:37:06 +0900 Subject: [PATCH] Fix wrong namespaces --- salt/utils/http.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/salt/utils/http.py b/salt/utils/http.py index 82bac75162..4eb1c155ac 100644 --- a/salt/utils/http.py +++ b/salt/utils/http.py @@ -267,10 +267,10 @@ def query(url, result_text = result.text result_cookies = result.cookies else: - request = urllib.Request(url, data) + request = urllib.request.Request(url, data) handlers = [ - urllib.HTTPHandler, - urllib.HTTPCookieProcessor(sess_cookies) + urllib.request.HTTPHandler, + urllib.request.HTTPCookieProcessor(sess_cookies) ] if url.startswith('https') or port == 443: @@ -316,7 +316,7 @@ def query(url, if hasattr(ssl, 'SSLContext'): # Python >= 2.7.9 context = ssl.SSLContext.load_cert_chain(*cert_chain) - handlers.append(urllib.HTTPSHandler(context=context)) # pylint: disable=E1123 + handlers.append(urllib.request.HTTPSHandler(context=context)) # pylint: disable=E1123 else: # Python < 2.7.9 cert_kwargs = { @@ -328,7 +328,7 @@ def query(url, cert_kwargs['key_file'] = cert_chain[1] handlers[0] = salt.ext.six.moves.http_client.HTTPSConnection(**cert_kwargs) - opener = urllib.build_opener(*handlers) + opener = urllib.request.build_opener(*handlers) for header in header_dict: request.add_header(header, header_dict[header]) request.get_method = lambda: method