set more semantic name for uploading stack template method

This commit is contained in:
Anton Chuchkalov 2016-01-13 14:57:01 +03:00
parent fae0c54b4b
commit 3c5362c7fd
2 changed files with 7 additions and 5 deletions

View File

@ -36,7 +36,7 @@ module Devops
def generate_template_file_and_upload_to_storage(id, json) def generate_template_file_and_upload_to_storage(id, json)
uniq_filename = "#{id}-#{SecureRandom.hex}.template" uniq_filename = "#{id}-#{SecureRandom.hex}.template"
provider_instance.store_file(uniq_filename, json)['url'] provider_instance.store_stack_template(uniq_filename, json)['url']
end end
end end

View File

@ -320,11 +320,13 @@ module Provider
self.compute.describe_vpcs.body["vpcSet"].select{|v| v["state"] == "available"}.map{|v| {"vpc_id" => v["vpcId"], "cidr" => v["cidrBlock"] } } self.compute.describe_vpcs.body["vpcSet"].select{|v| v["state"] == "available"}.map{|v| {"vpc_id" => v["vpcId"], "cidr" => v["cidrBlock"] } }
end end
# use public_url for a while because there is no possibility to create def store_stack_template(filename, json)
# non expiring private links via fog store_file(stack_templates_bucket, filename, json)
def store_file(filename, json) end
def store_file(bucket, filename, body)
{ {
'url' => stack_templates_bucket.files.create(key: filename, body: json, public: true).public_url 'url' => bucket.files.create(key: filename, body: body, public: true).public_url
} }
end end