1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #3092 from goruha/DescribeInstancesResponse-SAX-parcer-fix

Fix parsing of SpotInstanceRequests responce when we also specify NetworkInterface
This commit is contained in:
Wesley Beary 2014-08-07 08:17:11 -05:00
commit 0e581b6189

View file

@ -6,7 +6,7 @@ module Fog
def reset
@block_device_mapping = {}
@context = []
@contexts = ['blockDeviceMapping', 'groupSet', 'iamInstanceProfile']
@contexts = ['blockDeviceMapping', 'groupSet', 'iamInstanceProfile', 'networkInterfaceSet']
@spot_instance_request = { 'launchSpecification' => { 'iamInstanceProfile' => {}, 'blockDeviceMapping' => [], 'groupSet' => [] } }
@response = { 'spotInstanceRequestSet' => [] }
end
@ -34,7 +34,9 @@ module Fog
when 'deviceName', 'status', 'volumeId'
@block_device_mapping[name] = value
when 'groupId'
@spot_instance_request['launchSpecification']['groupSet'] << value
if !@context.include?('networkInterfaceSet')
@spot_instance_request['launchSpecification']['groupSet'] << value
end
when 'arn', 'name'
@spot_instance_request['launchSpecification']['iamInstanceProfile'][name] = value
when 'instanceId', 'launchedAvailabilityZone', 'productDescription', 'spotInstanceRequestId', 'state', 'type'