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
|
@instance[name] = @value.to_i
|
||||||
when 'availabilityZone'
|
when 'availabilityZone'
|
||||||
@instance['placement'][name] = @value
|
@instance['placement'][name] = @value
|
||||||
when 'architecture', 'clientToken', 'dnsName', 'imageId', 'instanceId',
|
when 'architecture', 'clientToken', 'dnsName', 'imageId',
|
||||||
'instanceType', 'ipAddress', 'kernelId', 'keyName',
|
'instanceId', 'instanceType', 'ipAddress', 'kernelId',
|
||||||
'privateDnsName', 'privateIpAddress', 'ramdiskId', 'reason',
|
'keyName', 'privateDnsName', 'privateIpAddress', 'ramdiskId',
|
||||||
'rootDeviceType'
|
'reason', 'rootDeviceType'
|
||||||
@instance[name] = @value
|
@instance[name] = @value
|
||||||
when 'attachTime'
|
when 'attachTime'
|
||||||
@block_device_mapping[name] = Time.parse(@value)
|
@block_device_mapping[name] = Time.parse(@value)
|
||||||
|
|
|
@ -27,10 +27,10 @@ module Fog
|
||||||
case name
|
case name
|
||||||
when 'amiLaunchIndex'
|
when 'amiLaunchIndex'
|
||||||
@instance[name] = @value.to_i
|
@instance[name] = @value.to_i
|
||||||
when 'architecture', 'dnsName', 'imageId', 'instanceId',
|
when 'architecture', 'clientToken', 'dnsName', 'imageId',
|
||||||
'instanceType', 'ipAddress', 'kernelId', 'keyName',
|
'instanceId', 'instanceType', 'ipAddress', 'kernelId',
|
||||||
'privateDnsName', 'privateIpAddress', 'ramdiskId', 'reason',
|
'keyName', 'privateDnsName', 'privateIpAddress', 'ramdiskId',
|
||||||
'rootDeviceType'
|
'reason', 'rootDeviceType'
|
||||||
@instance[name] = @value
|
@instance[name] = @value
|
||||||
when 'availabilityZone'
|
when 'availabilityZone'
|
||||||
@instance['placement'][name] = @value
|
@instance['placement'][name] = @value
|
||||||
|
|
|
@ -179,7 +179,7 @@ module Fog
|
||||||
'ownerId' => instance['ownerId'],
|
'ownerId' => instance['ownerId'],
|
||||||
'reservationId' => instance['reservationId']
|
'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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ module Fog
|
||||||
options['UserData'] = Base64.encode64(options['UserData'])
|
options['UserData'] = Base64.encode64(options['UserData'])
|
||||||
end
|
end
|
||||||
|
|
||||||
idempotent = !options['ClientToken'].empty?
|
idempotent = options['ClientToken'].nil? || options['ClientToken'].empty?
|
||||||
|
|
||||||
request({
|
request({
|
||||||
'Action' => 'RunInstances',
|
'Action' => 'RunInstances',
|
||||||
|
@ -123,6 +123,7 @@ module Fog
|
||||||
instance = {
|
instance = {
|
||||||
'amiLaunchIndex' => i,
|
'amiLaunchIndex' => i,
|
||||||
'blockDeviceMapping' => [],
|
'blockDeviceMapping' => [],
|
||||||
|
'clientToken' => options['clientToken'],
|
||||||
'dnsName' => nil,
|
'dnsName' => nil,
|
||||||
'imageId' => image_id,
|
'imageId' => image_id,
|
||||||
'instanceId' => instance_id,
|
'instanceId' => instance_id,
|
||||||
|
|
|
@ -4,6 +4,7 @@ Shindo.tests('AWS::Compute | instance requests', ['aws']) do
|
||||||
# 'architecture' => String,
|
# 'architecture' => String,
|
||||||
'amiLaunchIndex' => Integer,
|
'amiLaunchIndex' => Integer,
|
||||||
'blockDeviceMapping' => [],
|
'blockDeviceMapping' => [],
|
||||||
|
'clientToken' => NilClass,
|
||||||
'dnsName' => NilClass,
|
'dnsName' => NilClass,
|
||||||
'imageId' => String,
|
'imageId' => String,
|
||||||
'instanceId' => String,
|
'instanceId' => String,
|
||||||
|
|
Loading…
Add table
Reference in a new issue