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

Fix for stacks that have capabilities. Without this the parser misinterprets stacks with capabilities set.

This commit is contained in:
atlantacs 2012-04-06 22:38:44 -03:00
parent 131259f0a5
commit 8c3721ff13

View file

@ -6,7 +6,7 @@ module Fog
class DescribeStacks < Fog::Parsers::Base
def reset
@stack = { 'Outputs' => [], 'Parameters' => [] }
@stack = { 'Outputs' => [], 'Parameters' => [], 'Capabilities' => [] }
@output = {}
@parameter = {}
@response = { 'Stacks' => [] }
@ -19,7 +19,9 @@ module Fog
@in_outputs = true
when 'Parameters'
@in_parameters = true
end
when 'Capabilities'
@in_capabilities = true
end
end
def end_element(name)
@ -43,11 +45,18 @@ module Fog
when 'Parameters'
@in_parameters = false
end
elsif @in_capabilities
case name
when 'member'
@stack['Capabilities'] << value
when 'Capabilities'
@in_capabilities = false
end
else
case name
when 'member'
@response['Stacks'] << @stack
@stack = { 'Outputs' => [], 'Parameters' => [] }
@stack = { 'Outputs' => [], 'Parameters' => [], 'Capabilities' => []}
when 'RequestId'
@response[name] = value
when 'CreationTime'