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
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),
# 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',
# 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'
# 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)