Skip to content

Fix Compute.describe_instance_status parser #735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/fog/aws/parsers/compute/describe_instance_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module AWS
module Compute
class DescribeInstanceStatus < Fog::Parsers::Base
def new_instance!
@instance = { 'instanceState' => {}, 'systemStatus' => { 'details' => [] }, 'instanceStatus' => { 'details' => [] }, 'eventsSet' => [] }
@instance = { 'instanceState' => {}, 'systemStatus' => { 'details' => [] }, 'instanceStatus' => { 'details' => [] }, 'attachedEbsStatus' => { 'details' => [] }, 'eventsSet' => [] }
end

def new_item!
Expand All @@ -31,6 +31,8 @@ def start_element(name, attrs=[])
@inside = :instanceState
when 'instanceStatus'
@inside = :instanceStatus
when 'attachedEbsStatus'
@inside = :attachedEbsStatus
when 'eventsSet'
@inside = :eventsSet
end
Expand All @@ -43,13 +45,13 @@ def end_element(name)
@instance[name] = value
when 'nextToken', 'requestId'
@response[name] = value
when 'systemStatus', 'instanceState', 'instanceStatus', 'eventsSet'
when 'systemStatus', 'instanceState', 'instanceStatus', 'attachedEbsStatus', 'eventsSet'
@inside = nil
when 'item'
case @inside
when :eventsSet
@instance['eventsSet'] << @item
when :systemStatus, :instanceStatus
when :systemStatus, :instanceStatus, :attachedEbsStatus
@instance[@inside.to_s]['details'] << @item
when nil
@response['instanceStatusSet'] << @instance
Expand Down