Skip to content

Commit

Permalink
Remap :name parameter into :bucket parameter
Browse files Browse the repository at this point in the history
Current implementation assumes that frontend composes
all the options that backend then just sends to AWS. But
there is an exception with :name option. While it is
needed on frontend (to display flash), it is rejected by AWS.

Initial idea was to just remove the :name option here in backend,
but turns out that renaming it to :bucket works better. Hence this
commit.

Signed-off-by: Miha Pleško <miha.plesko@xlab.si>
  • Loading branch information
miha-plesko committed Mar 24, 2017
1 parent 475b0ba commit 306d930
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def raw_cloud_object_store_container_clear
end

def self.raw_cloud_object_store_container_create(ext_management_system, options)
options.except!(:name) # name is part of general options, but S3 doesn't like it
# frontend stores name as :name, but amazon expects it as :bucket
options[:bucket] = options.delete(:name) unless options[:name].nil?

region = options[:create_bucket_configuration][:location_constraint]
connection = ext_management_system.connect(:region => region)
bucket = connection.create_bucket(options)
Expand Down

0 comments on commit 306d930

Please sign in to comment.