From 01d716bbb2365b7a33bd30059e95b94af6a3ac77 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 7 Apr 2020 20:00:52 +0800 Subject: [PATCH] test/rgw/rgw_multi: s/urllib.urlencode/urlparse.urlencode/ urllib in python3 does not offer urlencode anymore, so let's use six.moves.parse now. Signed-off-by: Kefu Chai (cherry picked from commit 4e87fcfea0dbfc7d05046cc24137b71d9ce52393) --- src/test/rgw/rgw_multi/zone_ps.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/rgw/rgw_multi/zone_ps.py b/src/test/rgw/rgw_multi/zone_ps.py index 2ae49a6621caa..adc3c33bb6b94 100644 --- a/src/test/rgw/rgw_multi/zone_ps.py +++ b/src/test/rgw/rgw_multi/zone_ps.py @@ -72,7 +72,7 @@ def make_request(conn, method, resource, parameters=None, sign_parameters=False, """ url_params = '' if parameters is not None: - url_params = urllib.urlencode(parameters) + url_params = urlparse.urlencode(parameters) # remove 'None' from keys with no values url_params = url_params.replace('=None', '') url_params = '?' + url_params @@ -212,7 +212,7 @@ class PSTopicS3: def get_config(self): """get topic info""" parameters = {'Action': 'GetTopic', 'TopicArn': self.topic_arn} - body = urllib.urlencode(parameters) + body = urlparse.urlencode(parameters) string_date = strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()) content_type = 'application/x-www-form-urlencoded; charset=utf-8' resource = '/' @@ -254,7 +254,7 @@ class PSTopicS3: """list all topics""" # note that boto3 supports list_topics(), however, the result only show ARNs parameters = {'Action': 'ListTopics'} - body = urllib.urlencode(parameters) + body = urlparse.urlencode(parameters) string_date = strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()) content_type = 'application/x-www-form-urlencoded; charset=utf-8' resource = '/' -- 2.39.5