From 6c2f40a5281a1cccf0cab82c620ef1c6a40dd6ef Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 7 Apr 2020 20:27:08 +0800 Subject: [PATCH] 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 --- qa/tasks/mgr/dashboard/test_rgw.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qa/tasks/mgr/dashboard/test_rgw.py b/qa/tasks/mgr/dashboard/test_rgw.py index 9cb3504b5ae35..321f09b0fa874 100644 --- a/qa/tasks/mgr/dashboard/test_rgw.py +++ b/qa/tasks/mgr/dashboard/test_rgw.py @@ -4,11 +4,11 @@ from __future__ import absolute_import import base64 import logging import time -import urllib from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.twofactor.totp import TOTP from cryptography.hazmat.primitives.hashes import SHA1 +from six.moves.urllib import parse from .helper import DashboardTestCase, JObj, JList, JLeaf @@ -292,7 +292,7 @@ class RgwBucketTest(RgwTestCase): def _verify_tenant_bucket(bucket, tenant, uid): full_bucket_name = '{}/{}'.format(tenant, bucket) _data = self._get('/api/rgw/bucket/{}'.format( - urllib.quote_plus(full_bucket_name))) + parse.quote_plus(full_bucket_name))) self.assertStatus(200) self.assertSchema(_data, JObj(sub_elems={ 'owner': JLeaf(str), @@ -314,7 +314,7 @@ class RgwBucketTest(RgwTestCase): # Update bucket: different user with different tenant, enable versioning. 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': 'testx2$teuth-test-user2', @@ -326,7 +326,7 @@ class RgwBucketTest(RgwTestCase): # Change owner to a non-tenanted user self._put( '/api/rgw/bucket/{}'.format( - urllib.quote_plus('testx2/teuth-test-bucket')), + parse.quote_plus('testx2/teuth-test-bucket')), params={ 'bucket_id': data['id'], 'uid': 'admin' @@ -355,7 +355,7 @@ class RgwBucketTest(RgwTestCase): # 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) -- 2.39.5