lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/compute/describe_images.rb in brightbox-cli-0.17.4 vs lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/compute/describe_images.rb in brightbox-cli-0.17.5
- old
+ new
@@ -16,40 +16,49 @@
def start_element(name, attrs = [])
super
case name
when 'blockDeviceMapping'
@in_block_device_mapping = true
+ when 'productCodes'
+ @in_product_codes = true
when 'stateReason'
@in_state_reason = true
when 'tagSet'
@in_tag_set = true
end
end
def end_element(name)
- if @in_tag_set
+ if @in_block_device_mapping
case name
- when 'item'
- @image['tagSet'][@tag['key']] = @tag['value']
- @tag = {}
- when 'key', 'value'
- @tag[name] = value
- when 'tagSet'
- @in_tag_set = false
- end
- elsif @in_block_device_mapping
- case name
when 'blockDeviceMapping'
@in_block_device_mapping = false
when 'deviceName', 'virtualName', 'snapshotId', 'deleteOnTermination'
@block_device_mapping[name] = value
when 'volumeSize'
@block_device_mapping[name] = value.to_i
when 'item'
@image['blockDeviceMapping'] << @block_device_mapping
@block_device_mapping = {}
end
+ elsif @in_product_codes
+ case name
+ when 'productCode'
+ @image['productCodes'] << value
+ when 'productCodes'
+ @in_product_codes = false
+ end
+ elsif @in_tag_set
+ case name
+ when 'item'
+ @image['tagSet'][@tag['key']] = @tag['value']
+ @tag = {}
+ when 'key', 'value'
+ @tag[name] = value
+ when 'tagSet'
+ @in_tag_set = false
+ end
elsif @in_state_reason
case name
when 'code', 'message'
@state_reason[name] = value
when 'stateReason'
@@ -68,11 +77,9 @@
@image[name] = false
end
when 'item'
@response['imagesSet'] << @image
@image = { 'blockDeviceMapping' => [], 'productCodes' => [], 'stateReason' => {}, 'tagSet' => {} }
- when 'productCode'
- @image['productCodes'] << value
when 'requestId'
@response[name] = value
end
end
end