]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/rgw: fix flake8 errors in test_rgw_reshard.py
authorCasey Bodley <cbodley@redhat.com>
Wed, 25 May 2022 18:13:55 +0000 (14:13 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 May 2022 19:47:34 +0000 (15:47 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
qa/workunits/rgw/test_rgw_reshard.py

index eba3811226a6c8eb98050c3c257c291ddc87412b..4147067b15bc993663dc4734513bd96958a11ca0 100755 (executable)
@@ -8,9 +8,6 @@ import json
 import boto3
 import botocore.exceptions
 import os
-import re
-
-from pprint import pprint
 
 """
 Rgw manual and dynamic resharding  testing against a running instance
@@ -281,10 +278,10 @@ def main():
 
     # TESTCASE 'check reshard removes olh entries with empty name'
     log.debug(' test: reshard removes olh entries with empty name')
-    bucket1.objects.all().delete()
+    bucket.objects.all().delete()
 
     # get name of shard 0 object, add a bogus olh entry with empty name
-    bucket_shard0 = '.dir.%s.0' % get_bucket_stats(BUCKET_NAME1).bucket_id
+    bucket_shard0 = '.dir.%s.0' % get_bucket_stats(BUCKET_NAME).bucket_id
     if 'CEPH_ROOT' in os.environ:
       k = '%s/qa/workunits/rgw/olh_noname_key' % os.environ['CEPH_ROOT']
       v = '%s/qa/workunits/rgw/olh_noname_val' % os.environ['CEPH_ROOT']
@@ -294,17 +291,17 @@ def main():
     exec_cmd('rados -p %s setomapval %s --omap-key-file %s < %s' % (INDEX_POOL, bucket_shard0, k, v))
 
     # check that bi list has one entry with empty name
-    cmd = exec_cmd('radosgw-admin bi list --bucket %s' % BUCKET_NAME1)
+    cmd = exec_cmd('radosgw-admin bi list --bucket %s' % BUCKET_NAME)
     json_op = json.loads(cmd.decode('utf-8', 'ignore')) # ignore utf-8 can't decode 0x80
     assert len(json_op) == 1
     assert json_op[0]['entry']['key']['name'] == ''
 
     # reshard to prune the bogus olh
-    cmd = exec_cmd('radosgw-admin bucket reshard --bucket %s --num-shards %s --yes-i-really-mean-it' % (BUCKET_NAME1, 1))
+    cmd = exec_cmd('radosgw-admin bucket reshard --bucket %s --num-shards %s --yes-i-really-mean-it' % (BUCKET_NAME, 1))
 
     # get new name of shard 0 object, check that bi list has zero entries
-    bucket_shard0 = '.dir.%s.0' % get_bucket_stats(BUCKET_NAME1).bucket_id
-    cmd = exec_cmd('radosgw-admin bi list --bucket %s' % BUCKET_NAME1)
+    bucket_shard0 = '.dir.%s.0' % get_bucket_stats(BUCKET_NAME).bucket_id
+    cmd = exec_cmd('radosgw-admin bi list --bucket %s' % BUCKET_NAME)
     json_op = json.loads(cmd)
     assert len(json_op) == 0