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:
parent
065eb4c257
commit
b11b9da37b
1 changed files with 25 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue