diff --git a/lib/reindex/s3_bucketd.py b/lib/reindex/s3_bucketd.py index ddfb5bb8..23d2631d 100644 --- a/lib/reindex/s3_bucketd.py +++ b/lib/reindex/s3_bucketd.py @@ -51,7 +51,7 @@ def inner(*args, **kwargs): return urllib.parse.quote(val.encode('utf-8')) return inner -Bucket = namedtuple('Bucket', ['userid', 'name', 'object_locked'], defaults=[False]) +Bucket = namedtuple('Bucket', ['userid', 'name', 'object_locked_enabled'], defaults=[False]) MPU = namedtuple('MPU', ['bucket', 'key', 'upload_id']) BucketContents = namedtuple('BucketContents', ['bucket', 'obj_count', 'total_size']) @@ -184,8 +184,8 @@ def get_next_marker(p): # We need to get the attributes for each bucket to determine if it is locked if self._only_latest_when_locked: bucket_attrs = self._get_bucket_attributes(bucket.name) - obj_lock_enabled = bucket_attrs.get('objectLockEnabled', False) - bucket = bucket._replace(object_locked=obj_lock_enabled) + object_locked_enabled = bucket_attrs.get('objectLockEnabled', False) + bucket = bucket._replace(object_locked_enabled=object_locked_enabled) buckets.append(bucket) if buckets: @@ -250,7 +250,7 @@ def _sum_objects(self, bucket, listing): data = json.loads(obj['value']) size = data.get('content-length', 0) - if self._only_latest_when_locked and bucket.object_locked and '\x00' in obj['key']: + if self._only_latest_when_locked and bucket.object_locked_enabled and '\x00' in obj['key']: _log.debug('Skipping versioned key: %s'%obj['key']) continue