]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rgw/rgw_multi: s/urllib.urlencode/urlparse.urlencode/
authorKefu Chai <kchai@redhat.com>
Tue, 7 Apr 2020 12:00:52 +0000 (20:00 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 7 Apr 2020 13:51:23 +0000 (21:51 +0800)
urllib in python3 does not offer urlencode anymore, so let's use
six.moves.parse now.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/rgw/rgw_multi/zone_ps.py

index 9b706d2b150f96cf6b809d75126ebc49a69f1419..d6b93771e604a30ae887228601686e9cb96c2cee 100644 (file)
@@ -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 = '/'