Compare commits

..

No commits in common. "cc35e86787aae4a96a614b33ec0bf50389cce18b" and "df40c01b2092acdaa4423c5a7c43b7bf7254e9c2" have entirely different histories.

1 changed files with 2 additions and 2 deletions

View File

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