mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #2116 from rackspace/default_v2
[Rackspace|Compute] Make Next Gen Servers the default server implementation for Rackspace
This commit is contained in:
commit
85bc9df3b7
3 changed files with 11 additions and 10 deletions
|
@ -24,13 +24,13 @@ module Fog
|
|||
when :rackspace
|
||||
version = attributes.delete(:version)
|
||||
version = version.to_s.downcase.to_sym unless version.nil?
|
||||
if version == :v2
|
||||
require 'fog/rackspace/compute_v2'
|
||||
Fog::Compute::RackspaceV2.new(attributes)
|
||||
else
|
||||
if version == :v1
|
||||
Fog::Logger.deprecation "First Gen Cloud Servers are deprecated. Please use `:version => :v2` attribute to use Next Gen Cloud Servers."
|
||||
require 'fog/rackspace/compute'
|
||||
Fog::Compute::Rackspace.new(attributes)
|
||||
else
|
||||
require 'fog/rackspace/compute_v2'
|
||||
Fog::Compute::RackspaceV2.new(attributes)
|
||||
end
|
||||
when :stormondemand
|
||||
require 'fog/storm_on_demand/compute'
|
||||
|
|
|
@ -8,7 +8,7 @@ module Fog
|
|||
@@data ||= Hash.new do |hash, key|
|
||||
hash[key] = begin
|
||||
#Compute V2
|
||||
flavor_id = Fog.credentials[:rackspace_flavor_id].to_s ||= Fog::Mock.random_numbers(1)
|
||||
flavor_id = Fog.credentials[:rackspace_flavor_id] ||= Fog::Mock.random_numbers(1)
|
||||
image_id = Fog.credentials[:rackspace_image_id] ||= Fog::Rackspace::MockData.uuid
|
||||
image_name = Fog::Mock.random_letters(6)
|
||||
network_id = Fog::Rackspace::MockData.uuid
|
||||
|
@ -115,9 +115,9 @@ module Fog
|
|||
|
||||
mock_data = {
|
||||
#Compute V2
|
||||
:flavors => Hash.new { |h,k| h[k] = flavor unless k == NOT_FOUND_ID },
|
||||
:images => Hash.new { |h,k| h[k] = image unless k == NOT_FOUND_ID },
|
||||
:networks => Hash.new { |h,k| h[k] = network unless k == NOT_FOUND_ID },
|
||||
:flavors => Hash.new { |h,k| h[k] = flavor unless [NOT_FOUND_ID, '0'].include?(k) },
|
||||
:images => Hash.new { |h,k| h[k] = image unless [NOT_FOUND_ID, '0'].include?(k) },
|
||||
:networks => Hash.new { |h,k| h[k] = network unless [NOT_FOUND_ID, '0'].include?(k) },
|
||||
:keys => [],
|
||||
:keypair => key_pair,
|
||||
:keypairs => [],
|
||||
|
|
|
@ -120,9 +120,10 @@ def compute_providers
|
|||
}
|
||||
},
|
||||
:rackspace => {
|
||||
:provider_attributes => { :version => :v1 },
|
||||
:provider_attributes => { :version => :v2 },
|
||||
:server_attributes => {
|
||||
:image_id => 49, # image 49 = Ubuntu 10.04 LTS (lucid)
|
||||
:image_id => "23b564c9-c3e6-49f9-bc68-86c7a9ab5018", # Ubuntu 12.04 LTS (Precise Pangolin)
|
||||
:flavor_id => 2,
|
||||
:name => "fog_#{Time.now.to_i}"
|
||||
},
|
||||
:mocked => true
|
||||
|
|
Loading…
Add table
Reference in a new issue