Turn off bucket validation to minimize S3 permissions.

boto attempts to validate the bucket when calling get_bucket by doing a
LIST with zero desired items. By turning off validate we can reduce the
permissions.
This commit is contained in:
Neil Williams
2012-07-19 14:52:27 -07:00
committed by Ricky Ramirez
parent e12dbdd046
commit 149567a797

View File

@@ -41,7 +41,7 @@ def send_file(bucketname, filename, content, content_type='text/plain', never_ex
# TODO: add ACL support instead of always using public-read
connection = S3Connection(KEY_ID, SECRET_KEY)
bucket = connection.get_bucket(bucketname)
bucket = connection.get_bucket(bucketname, validate=False)
k = bucket.new_key(filename)
headers={'Content-Type': content_type}