mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|compute] fixes to make clientToken work properly throughout
This commit is contained in:
parent
b6ae71066f
commit
cf724053a0
5 changed files with 12 additions and 10 deletions
|
@ -34,10 +34,10 @@ module Fog
|
|||
@instance[name] = @value.to_i
|
||||
when 'availabilityZone'
|
||||
@instance['placement'][name] = @value
|
||||
when 'architecture', 'clientToken', 'dnsName', 'imageId', 'instanceId',
|
||||
'instanceType', 'ipAddress', 'kernelId', 'keyName',
|
||||
'privateDnsName', 'privateIpAddress', 'ramdiskId', 'reason',
|
||||
'rootDeviceType'
|
||||
when 'architecture', 'clientToken', 'dnsName', 'imageId',
|
||||
'instanceId', 'instanceType', 'ipAddress', 'kernelId',
|
||||
'keyName', 'privateDnsName', 'privateIpAddress', 'ramdiskId',
|
||||
'reason', 'rootDeviceType'
|
||||
@instance[name] = @value
|
||||
when 'attachTime'
|
||||
@block_device_mapping[name] = Time.parse(@value)
|
||||
|
|
|
@ -27,10 +27,10 @@ module Fog
|
|||
case name
|
||||
when 'amiLaunchIndex'
|
||||
@instance[name] = @value.to_i
|
||||
when 'architecture', 'dnsName', 'imageId', 'instanceId',
|
||||
'instanceType', 'ipAddress', 'kernelId', 'keyName',
|
||||
'privateDnsName', 'privateIpAddress', 'ramdiskId', 'reason',
|
||||
'rootDeviceType'
|
||||
when 'architecture', 'clientToken', 'dnsName', 'imageId',
|
||||
'instanceId', 'instanceType', 'ipAddress', 'kernelId',
|
||||
'keyName', 'privateDnsName', 'privateIpAddress', 'ramdiskId',
|
||||
'reason', 'rootDeviceType'
|
||||
@instance[name] = @value
|
||||
when 'availabilityZone'
|
||||
@instance['placement'][name] = @value
|
||||
|
|
|
@ -179,7 +179,7 @@ module Fog
|
|||
'ownerId' => instance['ownerId'],
|
||||
'reservationId' => instance['reservationId']
|
||||
}
|
||||
reservation_set[instance['reservationId']]['instancesSet'] << instance.reject{|key,value| !['amiLaunchIndex', 'architecture', 'blockDeviceMapping', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'ipAddress', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'privateIpAddress', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceType'].include?(key)}
|
||||
reservation_set[instance['reservationId']]['instancesSet'] << instance.reject{|key,value| !['amiLaunchIndex', 'architecture', 'blockDeviceMapping', 'clientToken', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'ipAddress', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'privateIpAddress', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceType'].include?(key)}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ module Fog
|
|||
options['UserData'] = Base64.encode64(options['UserData'])
|
||||
end
|
||||
|
||||
idempotent = !options['ClientToken'].empty?
|
||||
idempotent = options['ClientToken'].nil? || options['ClientToken'].empty?
|
||||
|
||||
request({
|
||||
'Action' => 'RunInstances',
|
||||
|
@ -123,6 +123,7 @@ module Fog
|
|||
instance = {
|
||||
'amiLaunchIndex' => i,
|
||||
'blockDeviceMapping' => [],
|
||||
'clientToken' => options['clientToken'],
|
||||
'dnsName' => nil,
|
||||
'imageId' => image_id,
|
||||
'instanceId' => instance_id,
|
||||
|
|
|
@ -4,6 +4,7 @@ Shindo.tests('AWS::Compute | instance requests', ['aws']) do
|
|||
# 'architecture' => String,
|
||||
'amiLaunchIndex' => Integer,
|
||||
'blockDeviceMapping' => [],
|
||||
'clientToken' => NilClass,
|
||||
'dnsName' => NilClass,
|
||||
'imageId' => String,
|
||||
'instanceId' => String,
|
||||
|
|
Loading…
Add table
Reference in a new issue