vavavr00m / boto

Automatically exported from code.google.com/p/boto
1 stars 0 forks source link

Feature Request: Implement S3 delete bucket policy functionality #542

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, it does not appear that the s3 functionality can delete bucket 
policies. There is a method to get and set the policy, however. 

I added the following to bucket.py to implement delete bucket policy 
functionality:

 def delete_policy(self, headers=None):
        response = self.connection.make_request('DELETE', self.name,
                                                data='/?policy',
                                                query_args='policy',
                                                headers=headers)
        body = response.read()
        if response.status >= 200 and response.status <= 204: 
            return True 
        else:
            raise self.connection.provider.storage_response_error(
                response.status, response.reason, body)

For reference, see: 
http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?deletebucketpol
icy.html.

Thanks,
Jason

Original issue reported on code.google.com by jason.b....@gmail.com on 3 Aug 2011 at 11:31

GoogleCodeExporter commented 9 years ago
See https://github.com/boto/boto/issues/296 for tracking info.

Original comment by Mitch.Ga...@gmail.com on 8 Aug 2011 at 2:22