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

fix list_managed_policies parser

This commit is contained in:
Josh Lane 2015-05-29 16:15:52 -07:00
parent 065eb4c257
commit b11b9da37b

View file

@ -14,12 +14,37 @@ module Fog
@response['Policies'] << policy
end
def start_element(name,attrs = [])
case name
when 'AttachedPolicies'
@stack << name
when 'AttachedPolicy'
@policy = fresh_policy
when 'member'
if @stack.last == 'AttachedPolicies'
@policy = fresh_policy
end
end
super
end
def end_element(name)
case name
when 'RequestId', 'Marker'
@response[name] = value
when 'IsTruncated'
@response[name] = (value == 'true')
when 'PolicyArn', 'PolicyName'
@policy[name] = value
when 'AttachedPolicies'
if @stack.last == 'AttachedPolicies'
@stack.pop
end
when 'member'
if @stack.last == 'AttachedPolicies'
finished_policy(@policy)
@policy = nil
end
end
super
end