Skip to content

Commit 05343da

Browse files
jessewilestimvaillancourt
authored andcommitted
Fix S3 upload bug (#226)
* Do not invalidate upload on acl exception
1 parent cab7d3c commit 05343da

File tree

1 file changed

+4
-2
lines changed
  • mongodb_consistent_backup/Upload/S3

1 file changed

+4
-2
lines changed

mongodb_consistent_backup/Upload/S3/S3.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ def run(self):
107107
part_count += 1
108108
if part_count == chunk_count:
109109
self._multipart.complete_upload()
110-
key = self.bucket.get_key(key_name)
111110
if self.s3_acl:
112-
key.set_acl(self.s3_acl)
111+
try:
112+
self.bucket.set_acl(self.s3_acl, key_name)
113+
except Exception:
114+
logging.exception("Unable to set ACLs on uploaded key: {}.".format(key_name))
113115
self._upload_done = True
114116

115117
if self.remove_uploaded:

0 commit comments

Comments
 (0)