Browse Source

owner id is not what I expected -- switched to displayname for now

master
Adam Pippin 4 years ago
parent
commit
6c334b3f50
  1. 6
      mass_s3/mass_s3.py

6
mass_s3/mass_s3.py

@ -69,6 +69,7 @@ class MassS3:
if owner is not None:
args['FetchOwner'] = True
total = 0
while True:
list_objects_response = self.s3.list_objects_v2(**args)
@ -78,11 +79,12 @@ class MassS3:
for item in list_objects_response['Contents']:
if modified_since is not None and item['LastModified'] < modified_since:
continue
if owner is not None and item['Owner']['ID'] != owner:
if owner is not None and item['Owner']['DisplayName'] != owner:
continue
objects.append(item['Key'])
self.logger.debug('Retrieved ' + str(len(list_objects_response['Contents'])) + ' objects; kept ' + str(len(objects)) + ' so far')
total = total + len(list_objects_response['Contents'])
self.logger.debug('Got ' + str(total) + ' objects; kept ' + str(len(objects)))
if 'NextContinuationToken' in list_objects_response:
args['ContinuationToken'] = list_objects_response['NextContinuationToken']

Loading…
Cancel
Save