From ede6a85385f834e49f9ffd341696c0c435e14d59 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 25 May 2022 14:13:55 -0400 Subject: [PATCH] qa/rgw: fix flake8 errors in test_rgw_reshard.py Signed-off-by: Casey Bodley --- qa/workunits/rgw/test_rgw_reshard.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/qa/workunits/rgw/test_rgw_reshard.py b/qa/workunits/rgw/test_rgw_reshard.py index eba3811226a6c..4147067b15bc9 100755 --- a/qa/workunits/rgw/test_rgw_reshard.py +++ b/qa/workunits/rgw/test_rgw_reshard.py @@ -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 -- 2.39.5