From 6689724f0e5ec2a9f3f7f64d4954e54ef9fdd554 Mon Sep 17 00:00:00 2001 From: "Swapnil Kulkarni (coolsvap)" Date: Thu, 24 Dec 2015 12:14:44 +0530 Subject: [PATCH] Keep py3.X compatibility for urllib Change-Id: I463d00865b8f384d22798be4dd86b62f821af67c Partial-Bug:#1280105 --- .../tempest/services/network/json/network_client.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/neutron/tests/tempest/services/network/json/network_client.py b/neutron/tests/tempest/services/network/json/network_client.py index 25400ca2a..9221d8863 100644 --- a/neutron/tests/tempest/services/network/json/network_client.py +++ b/neutron/tests/tempest/services/network/json/network_client.py @@ -11,11 +11,9 @@ # under the License. import time -import urllib - from oslo_serialization import jsonutils as json -from six.moves.urllib import parse +from six.moves.urllib import parse as urlparse from tempest_lib.common.utils import misc from tempest_lib import exceptions as lib_exc @@ -106,7 +104,7 @@ class NetworkClientJSON(service_client.ServiceClient): def _list(**filters): uri = self.get_uri(plural_name) if filters: - uri += '?' + parse.urlencode(filters, doseq=1) + uri += '?' + urlparse.urlencode(filters, doseq=1) resp, body = self.get(uri) result = {plural_name: self.deserialize_list(body)} self.expected_success(200, resp.status) @@ -132,7 +130,7 @@ class NetworkClientJSON(service_client.ServiceClient): plural = self.pluralize(resource_name) uri = '%s/%s' % (self.get_uri(plural), resource_id) if fields: - uri += '?' + parse.urlencode(fields, doseq=1) + uri += '?' + urlparse.urlencode(fields, doseq=1) resp, body = self.get(uri) body = self.deserialize_single(body) self.expected_success(200, resp.status) @@ -632,7 +630,7 @@ class NetworkClientJSON(service_client.ServiceClient): def list_qos_policies(self, **filters): if filters: uri = '%s/qos/policies?%s' % (self.uri_prefix, - urllib.urlencode(filters)) + urlparse.urlencode(filters)) else: uri = '%s/qos/policies' % self.uri_prefix resp, body = self.get(uri) -- 2.45.2