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
|
@response['Policies'] << policy
|
||||||
end
|
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)
|
def end_element(name)
|
||||||
case name
|
case name
|
||||||
when 'RequestId', 'Marker'
|
when 'RequestId', 'Marker'
|
||||||
@response[name] = value
|
@response[name] = value
|
||||||
when 'IsTruncated'
|
when 'IsTruncated'
|
||||||
@response[name] = (value == 'true')
|
@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
|
end
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue