Skip to content

Commit

Permalink
object_locked => object_lock_enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tmacro committed Nov 21, 2023
1 parent 204f380 commit 271900c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/reindex/s3_bucketd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 271900c

Please sign in to comment.