mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute|brightbox] No need to hardcode a server type
* Default of "nano" is applied is used if not specified
This commit is contained in:
parent
f87cdfe7eb
commit
53a2ff43fc
1 changed files with 3 additions and 2 deletions
|
@ -29,7 +29,6 @@ module Fog
|
||||||
attribute :interfaces
|
attribute :interfaces
|
||||||
|
|
||||||
def initialize(attributes={})
|
def initialize(attributes={})
|
||||||
self.flavor_id ||= 'typ-4nssg' # Nano
|
|
||||||
self.image_id ||= 'img-2ab98' # Ubuntu Lucid 10.04 server (i686)
|
self.image_id ||= 'img-2ab98' # Ubuntu Lucid 10.04 server (i686)
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
@ -99,11 +98,13 @@ module Fog
|
||||||
requires :image_id
|
requires :image_id
|
||||||
options = {
|
options = {
|
||||||
:image => image_id,
|
:image => image_id,
|
||||||
:server_type => flavor_id,
|
|
||||||
:name => name,
|
:name => name,
|
||||||
:zone => zone_id,
|
:zone => zone_id,
|
||||||
:user_data => user_data
|
:user_data => user_data
|
||||||
}.delete_if {|k,v| v.nil? || v == "" }
|
}.delete_if {|k,v| v.nil? || v == "" }
|
||||||
|
unless flavor_id.nil? || flavor_id == ""
|
||||||
|
options.merge!(:server_type => flavor_id)
|
||||||
|
end
|
||||||
data = connection.create_server(options)
|
data = connection.create_server(options)
|
||||||
merge_attributes(data)
|
merge_attributes(data)
|
||||||
true
|
true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue