def create_bucket(credentials, name, opts={})
bucket = nil
safely do
begin
s3_client = s3_client(credentials)
bucket_location = opts['location']
if bucket_location
bucket = RightAws::S3::Bucket.create(s3_client, name, true, nil, :location => bucket_location)
else
bucket = RightAws::S3::Bucket.create(s3_client, name, true)
end
rescue RightAws::AwsError => e
raise e unless e.message =~ /BucketAlreadyExists/
raise Deltacloud::BackendError.new(409, e.class.to_s, e.message, e.backtrace)
end
end
convert_bucket(bucket)
end