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

Merge remote branch 'cparedes/blb'

This commit is contained in:
geemus 2011-04-11 11:34:08 -07:00
commit 4d1fc17bc6
3 changed files with 15 additions and 4 deletions

View file

@ -21,7 +21,7 @@ module Fog
attribute :storage
attribute :template
attr_accessor :password
attr_accessor :password, :lb_applications, :lb_services, :lb_backends
attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username
def initialize(attributes={})
@ -92,6 +92,14 @@ module Fog
options['password'] = password if @password
end
if @lb_backends
options['lb_backends'] = lb_backends
elsif @lb_services
options['lb_services'] = lb_services
elsif @lb_applications
options['lb_applications'] = lb_applications
end
options['username'] = username
data = connection.create_block(flavor_id, image_id, options)
merge_attributes(data.body)

View file

@ -9,7 +9,8 @@ def compute_providers
Bluebox => {
:server_attributes => {
:image_id => 'a00baa8f-b5d0-4815-8238-b471c4c4bf72', # Ubuntu 9.10 64bit
:password => 'chunkybacon'
:password => 'chunkybacon',
:lb_applications => '0ea478ca-d528-4764-9828-fc5f222c8c8c'
},
:mocked => false
},

View file

@ -6,6 +6,7 @@ Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
'hostname' => String,
'id' => String,
'ips' => [{'address' => String}],
'lb_applications' => [{'lb_application_name' => String, 'lb_application_id' => String}]
'memory' => Integer,
'product' => Bluebox::Compute::Formats::PRODUCT,
'status' => String,
@ -17,13 +18,14 @@ Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
@product_id = '94fd37a7-2606-47f7-84d5-9000deda52ae' # 1 GB
@template_id = 'a00baa8f-b5d0-4815-8238-b471c4c4bf72' # Ubuntu 9.10 64bit
@lb_applications = '0ea478ca-d528-4764-9828-fc5f222c8c8c'
@password = 'chunkybacon'
@block_id = nil
tests("create_block('#{@product_id}', '#{@template_id}', 'password' => '#{@password}')").formats(@block_format) do
tests("create_block('#{@product_id}', '#{@template_id}', {'password' => '#{@password}', 'lb_applications' => '#{@lb_applications}'})").formats(@block_format) do
pending if Fog.mocking?
data = Bluebox[:compute].create_block(@product_id, @template_id, 'password' => @password).body
data = Bluebox[:compute].create_block(@product_id, @template_id, {'password' => @password, 'lb_applications' => @lb_applications}).body
@block_id = data['id']
data
end