Skip to content

Commit

Permalink
[compute|brightbox] No need to hardcode a server type
Browse files Browse the repository at this point in the history
* Default of "nano" is applied is used if not specified
  • Loading branch information
tokengeek committed Aug 19, 2011
1 parent f87cdfe commit 53a2ff4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/fog/compute/models/brightbox/server.rb
Expand Up @@ -29,7 +29,6 @@ class Server < Fog::Compute::Server
attribute :interfaces

def initialize(attributes={})
self.flavor_id ||= 'typ-4nssg' # Nano
self.image_id ||= 'img-2ab98' # Ubuntu Lucid 10.04 server (i686)
super
end
Expand Down Expand Up @@ -99,11 +98,13 @@ def save
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
Expand Down

0 comments on commit 53a2ff4

Please sign in to comment.