def upgrade(self): super(S3Storage, self).upgrade() try: s3.create_bucket(self.s3, self._bucket_name, self._region_name) except botocore.exceptions.ClientError as e: if e.response['Error'].get('Code') != "BucketAlreadyExists": raise
def upgrade(self, num_sacks): try: s3.create_bucket(self.s3, self._bucket_name_measures, self._region_name) except botocore.exceptions.ClientError as e: if e.response['Error'].get('Code') not in ( "BucketAlreadyExists", "BucketAlreadyOwnedByYou"): raise # need to create bucket first to store storage settings object super(S3Storage, self).upgrade(num_sacks)
def upgrade(self, num_sacks): try: s3.create_bucket(self.s3, self._bucket_name_measures, self._region_name) except botocore.exceptions.ClientError as e: if e.response['Error'].get('Code') not in ( "BucketAlreadyExists", "BucketAlreadyOwnedByYou" ): raise # need to create bucket first to store storage settings object super(S3Storage, self).upgrade(num_sacks)