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

[ecloud|compute] Fixes ecloud server tests

Fixes regression in #1473, attempting to create an Elcoud service
connection even when tests should not run fails due to missing
credentials.
This commit is contained in:
Paul Thornthwaite 2013-01-15 17:30:11 +00:00
parent a2255c7a66
commit 97a7a1faf8

View file

@ -1,13 +1,13 @@
provider, config = :ecloud, compute_providers[:ecloud] provider, config = :ecloud, compute_providers[:ecloud]
connection = Fog::Compute[provider]
organization = connection.organizations.first
environment = organization.environments.find{|e| e.name == config[:server_attributes][:environment_name]} || organization.environments.first
public_ip = environment.public_ips.first
compute_pool = environment.compute_pools.first
image_href = Fog.credentials[:ecloud_image_href] || compute_pool.templates.first.href
ssh_key = organization.admin.ssh_keys.detect { |key| key.name == "root" }
Shindo.tests("Fog::Compute[:#{provider}] | servers", [provider.to_s, "operations"]) do Shindo.tests("Fog::Compute[:#{provider}] | servers", [provider.to_s, "operations"]) do
connection = Fog::Compute[provider]
organization = connection.organizations.first
environment = organization.environments.find{|e| e.name == config[:server_attributes][:environment_name]} || organization.environments.first
public_ip = environment.public_ips.first
compute_pool = environment.compute_pools.first
image_href = Fog.credentials[:ecloud_image_href] || compute_pool.templates.first.href
ssh_key = organization.admin.ssh_keys.detect { |key| key.name == "root" }
@network = environment.networks.first @network = environment.networks.first
options = config[:server_attributes].merge(:network_uri => @network.href, :ssh_key_uri => ssh_key.href) options = config[:server_attributes].merge(:network_uri => @network.href, :ssh_key_uri => ssh_key.href)