1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

modified create function to include options. changed "diskConfig" to "OS-DCF:diskConfig" to allow disk configuration to be properly set.

This commit is contained in:
Alex Dunn 2012-10-08 15:16:41 -07:00
parent ccb633f899
commit 0ca2117397
2 changed files with 5 additions and 3 deletions

View file

@ -40,7 +40,8 @@ module Fog
attribute :addresses
attribute :flavor_id, :aliases => 'flavor', :squash => 'id'
attribute :image_id, :aliases => 'image', :squash => 'id'
attribute :options
attr_reader :password
def save
@ -54,7 +55,8 @@ module Fog
def create
requires :name, :image_id, :flavor_id
data = connection.create_server(name, image_id, flavor_id, 1, 1)
options = {} if options.nil?
data = connection.create_server(name, image_id, flavor_id, 1, 1, options)
merge_attributes(data.body['server'])
true
end

View file

@ -13,7 +13,7 @@ module Fog
}
}
data['server']['diskConfig'] = options[:disk_config] unless options[:disk_config].nil?
data['server']['OS-DCF:diskConfig'] = options[:disk_config] unless options[:disk_config].nil?
request(
:body => Fog::JSON.encode(data),