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:
parent
ccb633f899
commit
0ca2117397
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue