From d87557aa1d1f1e12ad572b73bcefe053f1b5ac04 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Wed, 1 Jul 2015 19:16:43 +0000 Subject: [PATCH] Python3: do not use urllib.urlencode It has been moved in Python3. Use six.moves to have code that works with both Python 2 and 3. Change-Id: I5f286b1f784b3b7bb37852b00169a6c1227eb74b Blueprint: neutron-python3 --- .../tests/tempest/services/network/json/network_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neutron/tests/tempest/services/network/json/network_client.py b/neutron/tests/tempest/services/network/json/network_client.py index 82271f71..54f264c8 100644 --- a/neutron/tests/tempest/services/network/json/network_client.py +++ b/neutron/tests/tempest/services/network/json/network_client.py @@ -12,8 +12,8 @@ import json import time -import urllib +from six.moves.urllib import parse from tempest_lib.common.utils import misc from tempest_lib import exceptions as lib_exc @@ -98,7 +98,7 @@ class NetworkClientJSON(service_client.ServiceClient): def _list(**filters): uri = self.get_uri(plural_name) if filters: - uri += '?' + urllib.urlencode(filters, doseq=1) + uri += '?' + parse.urlencode(filters, doseq=1) resp, body = self.get(uri) result = {plural_name: self.deserialize_list(body)} self.expected_success(200, resp.status) @@ -124,7 +124,7 @@ class NetworkClientJSON(service_client.ServiceClient): plural = self.pluralize(resource_name) uri = '%s/%s' % (self.get_uri(plural), resource_id) if fields: - uri += '?' + urllib.urlencode(fields, doseq=1) + uri += '?' + parse.urlencode(fields, doseq=1) resp, body = self.get(uri) body = self.deserialize_single(body) self.expected_success(200, resp.status)