]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/mgr: s/urllib.quote_plus/parse.quote_plus/
authorKefu Chai <kchai@redhat.com>
Tue, 7 Apr 2020 12:27:08 +0000 (20:27 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Jun 2020 11:56:59 +0000 (19:56 +0800)
in Python3, urllib.quote_plus is moved into urllib.parse, let's use
six.moves at this moment.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 6c2f40a5281a1cccf0cab82c620ef1c6a40dd6ef)

Conflicts:
qa/tasks/mgr/dashboard/test_rgw.py: trivial resolution

qa/tasks/mgr/dashboard/test_rgw.py

index 34f337f8df37e7ae1288943dcaf85908527fc225..dc119b3002bd74c2a05197e071655898125128c0 100644 (file)
@@ -2,8 +2,8 @@
 from __future__ import absolute_import
 
 import logging
-import urllib
 import six
+from six.moves.urllib import parse
 
 from .helper import DashboardTestCase, JObj, JList, JLeaf
 
@@ -225,7 +225,7 @@ class RgwBucketTest(RgwTestCase):
 
         # Get the bucket.
         data = self._get('/api/rgw/bucket/{}'.format(
-            urllib.quote_plus('testx/teuth-test-bucket')))
+            parse.quote_plus('testx/teuth-test-bucket')))
         self.assertStatus(200)
         self.assertSchema(data, JObj(sub_elems={
             'owner': JLeaf(str),
@@ -241,14 +241,14 @@ class RgwBucketTest(RgwTestCase):
         # Update bucket: different user from same tenant.
         self._put(
             '/api/rgw/bucket/{}'.format(
-                urllib.quote_plus('testx/teuth-test-bucket')),
+                parse.quote_plus('testx/teuth-test-bucket')),
             params={
                 'bucket_id': data['id'],
                 'uid': 'testx$teuth-test-user2'
             })
         self.assertStatus(200)
         data = self._get('/api/rgw/bucket/{}'.format(
-            urllib.quote_plus('testx/teuth-test-bucket')))
+            parse.quote_plus('testx/teuth-test-bucket')))
         self.assertStatus(200)
         self.assertIn('owner', data)
         self.assertEqual(data['owner'], 'testx$teuth-test-user2')
@@ -256,21 +256,21 @@ class RgwBucketTest(RgwTestCase):
         # Update bucket: different user from empty tenant.
         self._put(
             '/api/rgw/bucket/{}'.format(
-                urllib.quote_plus('testx/teuth-test-bucket')),
+                parse.quote_plus('testx/teuth-test-bucket')),
             params={
                 'bucket_id': data['id'],
                 'uid': 'admin'
             })
         self.assertStatus(200)
         data = self._get('/api/rgw/bucket/{}'.format(
-            urllib.quote_plus('testx/teuth-test-bucket')))
+            parse.quote_plus('testx/teuth-test-bucket')))
         self.assertStatus(200)
         self.assertIn('owner', data)
         self.assertEqual(data['owner'], 'admin')
 
         # Delete the bucket.
         self._delete('/api/rgw/bucket/{}'.format(
-            urllib.quote_plus('testx/teuth-test-bucket')))
+            parse.quote_plus('testx/teuth-test-bucket')))
         self.assertStatus(204)
         data = self._get('/api/rgw/bucket')
         self.assertStatus(200)