mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[AWS|Compute] Add the ablity to pass :version and use newer AWS API
This commit is contained in:
parent
77184bc668
commit
76ea6b97d0
3 changed files with 6 additions and 6 deletions
|
@ -7,7 +7,7 @@ module Fog
|
||||||
extend Fog::AWS::CredentialFetcher::ServiceMethods
|
extend Fog::AWS::CredentialFetcher::ServiceMethods
|
||||||
|
|
||||||
requires :aws_access_key_id, :aws_secret_access_key
|
requires :aws_access_key_id, :aws_secret_access_key
|
||||||
recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
|
recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :version
|
||||||
|
|
||||||
secrets :aws_secret_access_key, :hmac, :aws_session_token
|
secrets :aws_secret_access_key, :hmac, :aws_session_token
|
||||||
|
|
||||||
|
@ -317,6 +317,7 @@ module Fog
|
||||||
@region = options[:region] ||= 'us-east-1'
|
@region = options[:region] ||= 'us-east-1'
|
||||||
@instrumentor = options[:instrumentor]
|
@instrumentor = options[:instrumentor]
|
||||||
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.compute'
|
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.compute'
|
||||||
|
@version = options[:version] || '2012-07-20'
|
||||||
|
|
||||||
if @endpoint = options[:endpoint]
|
if @endpoint = options[:endpoint]
|
||||||
endpoint = URI.parse(@endpoint)
|
endpoint = URI.parse(@endpoint)
|
||||||
|
@ -362,7 +363,7 @@ module Fog
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:path => @path,
|
:path => @path,
|
||||||
:port => @port,
|
:port => @port,
|
||||||
:version => '2012-07-20'
|
:version => @version
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,6 @@ module Fog
|
||||||
attributes = attributes.dup # prevent delete from having side effects
|
attributes = attributes.dup # prevent delete from having side effects
|
||||||
provider = attributes.delete(:provider).to_s.downcase.to_sym
|
provider = attributes.delete(:provider).to_s.downcase.to_sym
|
||||||
|
|
||||||
version = attributes.delete(:version)
|
|
||||||
version = version.to_s.downcase.to_sym unless version.nil?
|
|
||||||
|
|
||||||
case provider
|
case provider
|
||||||
when :aws
|
when :aws
|
||||||
require 'fog/aws/compute'
|
require 'fog/aws/compute'
|
||||||
|
@ -69,6 +66,8 @@ module Fog
|
||||||
require 'fog/ovirt/compute'
|
require 'fog/ovirt/compute'
|
||||||
Fog::Compute::Ovirt.new(attributes)
|
Fog::Compute::Ovirt.new(attributes)
|
||||||
when :rackspace
|
when :rackspace
|
||||||
|
version = attributes.delete(:version)
|
||||||
|
version = version.to_s.downcase.to_sym unless version.nil?
|
||||||
if version == :v2
|
if version == :v2
|
||||||
require 'fog/rackspace/compute_v2'
|
require 'fog/rackspace/compute_v2'
|
||||||
Fog::Compute::RackspaceV2.new(attributes)
|
Fog::Compute::RackspaceV2.new(attributes)
|
||||||
|
|
|
@ -167,7 +167,7 @@ Shindo.tests('Fog::Compute[:aws] | instance requests', ['aws']) do
|
||||||
'ami-6bbb1302' # ubuntu 12.04 daily build 20120728
|
'ami-6bbb1302' # ubuntu 12.04 daily build 20120728
|
||||||
else
|
else
|
||||||
# Use a MS Windows AMI to test #get_password_data
|
# Use a MS Windows AMI to test #get_password_data
|
||||||
'ami-c941efa0' # Amazon Public Images - Windows_Server-2008-SP2-English-64Bit-Base-2012.07.11
|
'ami-71b50018' # Amazon Public Images - Windows_Server-2008-SP2-English-64Bit-Base-2012.07.11
|
||||||
end
|
end
|
||||||
|
|
||||||
# Create a keypair for decrypting the password
|
# Create a keypair for decrypting the password
|
||||||
|
|
Loading…
Add table
Reference in a new issue