From: Kefu Chai Date: Tue, 7 Apr 2020 12:27:08 +0000 (+0800) Subject: qa/tasks/mgr: s/urllib.quote_plus/parse.quote_plus/ X-Git-Tag: v14.2.10~17^2~49 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cefd2867c524e436c2ff7a8f9145145caadf990b;p=ceph.git qa/tasks/mgr: s/urllib.quote_plus/parse.quote_plus/ in Python3, urllib.quote_plus is moved into urllib.parse, let's use six.moves at this moment. Signed-off-by: Kefu Chai (cherry picked from commit 6c2f40a5281a1cccf0cab82c620ef1c6a40dd6ef) Conflicts: qa/tasks/mgr/dashboard/test_rgw.py: trivial resolution --- diff --git a/qa/tasks/mgr/dashboard/test_rgw.py b/qa/tasks/mgr/dashboard/test_rgw.py index 34f337f8df37..dc119b3002bd 100644 --- a/qa/tasks/mgr/dashboard/test_rgw.py +++ b/qa/tasks/mgr/dashboard/test_rgw.py @@ -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)