Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add explicit support for canned-acl policy to Multipart Uploads.

- policy is a canned-acl policy similar to key.set_contents_*() apis.
  • Loading branch information...
commit c283da95f42f46e302887e3b09a0eaef859e4773 1 parent bdddbbd
authored April 09, 2012

Showing 1 changed file with 9 additions and 3 deletions. Show diff stats Hide diff stats

  1. 12  boto/s3/bucket.py
12  boto/s3/bucket.py
@@ -1334,7 +1334,8 @@ def delete_policy(self, headers=None):
1334 1334
 
1335 1335
     def initiate_multipart_upload(self, key_name, headers=None,
1336 1336
                                   reduced_redundancy=False,
1337  
-                                  metadata=None, encrypt_key=False):
  1337
+                                  metadata=None, encrypt_key=False,
  1338
+                                  policy=None):
1338 1339
         """
1339 1340
         Start a multipart upload operation.
1340 1341
 
@@ -1365,11 +1366,16 @@ def initiate_multipart_upload(self, key_name, headers=None,
1365 1366
                             be encrypted on the server-side by S3 and
1366 1367
                             will be stored in an encrypted form while
1367 1368
                             at rest in S3.
  1369
+
  1370
+        :type policy: :class:`boto.s3.acl.CannedACLStrings`
  1371
+        :param policy: A canned ACL policy that will be applied to the
  1372
+                       new key (once completed) in S3.
1368 1373
         """
1369 1374
         query_args = 'uploads'
1370 1375
         provider = self.connection.provider
1371  
-        if headers is None:
1372  
-            headers = {}
  1376
+        headers = headers or {}
  1377
+        if policy:
  1378
+            headers[provider.acl_header] = policy
1373 1379
         if reduced_redundancy:
1374 1380
             storage_class_header = provider.storage_class_header
1375 1381
             if storage_class_header:

0 notes on commit c283da9

Please sign in to comment.
Something went wrong with that request. Please try again.