Compare commits

...

2 Commits

Author SHA1 Message Date
scality-gelbart cc35e86787
work around S3C-4119 2021-03-11 21:22:03 +01:00
scality-gelbart 56d268076b
Update s3_bucketd.py 2021-03-11 21:10:00 +01:00
1 changed files with 2 additions and 2 deletions

View File

@ -196,7 +196,7 @@ class BucketDClient:
else:
# bucketd v7 returns an encoded string
data = json.loads(obj['value'])
size = data["content-length"]
size = data.get('content-length', 0)
total_size += size
# If versioned, subtract the size of the master to avoid double counting
@ -361,7 +361,7 @@ if __name__ == '__main__':
recorded_buckets = set(get_resources_from_redis(redis_client, 'buckets'))
if options.bucket is None:
stale_buckets = recorded_buckets.difference(observed_buckets)
elif observed_buckets and options.bucket in recorded_buckets:
elif observed_buckets and options.bucket not in recorded_buckets:
# The provided bucket does not exist, so clean up any metrics
stale_buckets = { options.bucket }
else: