From: Kefu Chai Date: Tue, 7 Apr 2020 12:00:52 +0000 (+0800) Subject: test/rgw/rgw_multi: s/urllib.urlencode/urlparse.urlencode/ X-Git-Tag: v16.1.0~2648^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4e87fcfea0dbfc7d05046cc24137b71d9ce52393;p=ceph.git 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 --- diff --git a/src/test/rgw/rgw_multi/zone_ps.py b/src/test/rgw/rgw_multi/zone_ps.py index 9b706d2b150f..d6b93771e604 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 = '/'