1
0
Fork 0
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:
Paul Thornthwaite 2011-08-19 13:55:07 +01:00
parent f87cdfe7eb
commit 53a2ff43fc

View file

@ -29,7 +29,6 @@ module Fog
attribute :interfaces
def initialize(attributes={})
self.flavor_id ||= 'typ-4nssg' # Nano
self.image_id ||= 'img-2ab98' # Ubuntu Lucid 10.04 server (i686)
super
end
@ -99,11 +98,13 @@ module Fog
requires :image_id
options = {
:image => image_id,
:server_type => flavor_id,
:name => name,
:zone => zone_id,
:user_data => user_data
}.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)
merge_attributes(data)
true