mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1134 from zsiddique/master
[AWS|Compute] Add the ablity to pass :version and use newer AWS API
This commit is contained in:
commit
20e0f49265
3 changed files with 6 additions and 6 deletions
|
@ -7,7 +7,7 @@ module Fog
|
|||
extend Fog::AWS::CredentialFetcher::ServiceMethods
|
||||
|
||||
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
|
||||
|
||||
|
@ -317,6 +317,7 @@ module Fog
|
|||
@region = options[:region] ||= 'us-east-1'
|
||||
@instrumentor = options[:instrumentor]
|
||||
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.compute'
|
||||
@version = options[:version] || '2012-07-20'
|
||||
|
||||
if @endpoint = options[:endpoint]
|
||||
endpoint = URI.parse(@endpoint)
|
||||
|
@ -362,7 +363,7 @@ module Fog
|
|||
:host => @host,
|
||||
:path => @path,
|
||||
:port => @port,
|
||||
:version => '2012-07-20'
|
||||
:version => @version
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -9,9 +9,6 @@ module Fog
|
|||
attributes = attributes.dup # prevent delete from having side effects
|
||||
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
|
||||
when :aws
|
||||
require 'fog/aws/compute'
|
||||
|
@ -69,6 +66,8 @@ module Fog
|
|||
require 'fog/ovirt/compute'
|
||||
Fog::Compute::Ovirt.new(attributes)
|
||||
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)
|
||||
|
|
|
@ -167,7 +167,7 @@ Shindo.tests('Fog::Compute[:aws] | instance requests', ['aws']) do
|
|||
'ami-6bbb1302' # ubuntu 12.04 daily build 20120728
|
||||
else
|
||||
# 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
|
||||
|
||||
# Create a keypair for decrypting the password
|
||||
|
|
Loading…
Reference in a new issue