summaryrefslogtreecommitdiff
path: root/boto/storage_uri.py
diff options
context:
space:
mode:
authorMitch Garnaat <mitch@garnaat.com>2012-05-15 18:59:46 -0700
committerMitch Garnaat <mitch@garnaat.com>2012-05-15 18:59:46 -0700
commit1aa1133e8502ea6c95e49ac34681569df5ace46b (patch)
treea25397b20d7d409131ccfbfce5d4dca23d7e52a4 /boto/storage_uri.py
parent911f42b97fdccbc55e160ec323df0cad6fe64c6b (diff)
parent6588ea270bfc9e0bb4d17263b72ee8b5255545c5 (diff)
downloadboto-2.4.0.tar.gz
Merge branch 'release-2.4.0'2.4.0
Diffstat (limited to 'boto/storage_uri.py')
-rwxr-xr-xboto/storage_uri.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/boto/storage_uri.py b/boto/storage_uri.py
index 5f14500d..9661c9f7 100755
--- a/boto/storage_uri.py
+++ b/boto/storage_uri.py
@@ -268,6 +268,22 @@ class BucketStorageUri(StorageUri):
self.check_response(acl, 'acl', self.uri)
return acl
+ def get_cors(self, validate=True, headers=None):
+ """returns a bucket's CORS XML"""
+ if not self.bucket_name:
+ raise InvalidUriError('get_cors on bucket-less URI (%s)' % self.uri)
+ bucket = self.get_bucket(validate, headers)
+ cors = bucket.get_cors(headers)
+ self.check_response(cors, 'cors', self.uri)
+ return cors
+
+ def set_cors(self, cors, validate=True, headers=None):
+ """sets or updates a bucket's CORS XML"""
+ if not self.bucket_name:
+ raise InvalidUriError('set_cors on bucket-less URI (%s)' % self.uri)
+ bucket = self.get_bucket(validate, headers)
+ bucket.set_cors(cors.to_xml(), headers)
+
def get_location(self, validate=True, headers=None):
if not self.bucket_name:
raise InvalidUriError('get_location on bucket-less URI (%s)' %