Commits

Dhananjay Nene committed 978ced7

Added delete bucket capability

  • Participants
  • Parent commits 79135f2
  • Branches py2to3
  • Tags 0.0.2

Comments (0)

Files changed (1)

File src/pybuckets/botos3.py

+from .pybuckets import Bucket, BucketServer, DuplicateBucketNameException, \
+    BucketsException, server_registry, build_kw_from_params_and_object
 from boto.exception import S3CreateError
 from boto.s3.bucket import Bucket as BotoBucket
 from boto.s3.connection import S3Connection
 from boto.s3.key import Key
-from .pybuckets import Bucket, BucketServer, DuplicateBucketNameException, \
-    BucketsException, server_registry
-from .pybuckets import build_kw_from_params_and_object
 import operator
 
 # S3CreateError - body, box_usage, bucket, error_code, error_message,message,reason,request_id,status
     def create_using_boto_bucket(self,boto_bucket):
         bucket = BotoS3Bucket(boto_bucket.name,self)
         return bucket
+    
+    def delete_bucket(self,name):
+        bucket = self.connection.get_bucket(name, validate=True, headers=None)
+        self.connection.delete_bucket(bucket)
 
 server_registry['botos3'] = BotoS3Server