From 6c334b3f5044b2a71fb97a62651f93b68f6315c5 Mon Sep 17 00:00:00 2001 From: Adam Pippin Date: Tue, 31 Mar 2020 13:57:31 -0700 Subject: [PATCH] owner id is not what I expected -- switched to displayname for now --- mass_s3/mass_s3.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mass_s3/mass_s3.py b/mass_s3/mass_s3.py index 095361d..8240f4c 100644 --- a/mass_s3/mass_s3.py +++ b/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']