def create_bucket(bucket, headers={})
data = nil
location = case headers[:location].to_s
when 'us','US' then ''
when 'eu' then 'EU'
else headers[:location].to_s
end
unless location.blank?
data = "<CreateBucketConfiguration><LocationConstraint>#{location}</LocationConstraint></CreateBucketConfiguration>"
end
req_hash = generate_rest_request('PUT', headers.merge(:url=>bucket, :data => data))
request_info(req_hash, RightHttp2xxParser.new)
rescue Exception => e
e.is_a?(RightAws::AwsError) && e.message.include?('BucketAlreadyOwnedByYou') ? true : on_exception
end