mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[AWS|AutoScaling] Fix describe_auto_scaling_groups parser added spurious nil groups
This commit is contained in:
parent
cb0bc181a1
commit
95965df442
3 changed files with 11 additions and 2 deletions
|
@ -15,7 +15,8 @@ module Fog
|
|||
end
|
||||
|
||||
def reset_auto_scaling_group
|
||||
@auto_scaling_group = { 'AvailabilityZones' => [], 'EnabledMetrics' => [], 'Instances' => [], 'LoadBalancerNames' => [], 'SuspendedProcesses' => [] }
|
||||
@auto_scaling_group = { 'AvailabilityZones' => [], 'EnabledMetrics' => [], 'Instances' => [],
|
||||
'LoadBalancerNames' => [], 'SuspendedProcesses' => [], 'TerminationPolicies' => [] }
|
||||
end
|
||||
|
||||
def reset_enabled_metric
|
||||
|
@ -43,6 +44,8 @@ module Fog
|
|||
@in_load_balancer_names = true
|
||||
when 'SuspendedProcesses'
|
||||
@in_suspended_processes = true
|
||||
when 'TerminationPolicies'
|
||||
@in_termination_policies = true
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -62,6 +65,8 @@ module Fog
|
|||
elsif @in_suspended_processes
|
||||
@auto_scaling_group['SuspendedProcesses'] << @suspended_process
|
||||
reset_suspended_process
|
||||
elsif @in_termination_policies
|
||||
@auto_scaling_group['TerminationPolicies'] << value
|
||||
elsif !@in_instances && !@in_policies
|
||||
@results['AutoScalingGroups'] << @auto_scaling_group
|
||||
reset_auto_scaling_group
|
||||
|
@ -81,6 +86,8 @@ module Fog
|
|||
else
|
||||
@auto_scaling_group[name] = value
|
||||
end
|
||||
when 'TerminationPolicies'
|
||||
@in_termination_policies = false
|
||||
|
||||
when 'AvailabilityZone', 'HealthStatus', 'InstanceId', 'LifecycleState'
|
||||
@instance[name] = value
|
||||
|
|
|
@ -98,6 +98,7 @@ module Fog
|
|||
'MinSize' => min_size,
|
||||
'PlacementGroup' => nil,
|
||||
'SuspendedProcesses' => [],
|
||||
'TerminationPolicies' => [],
|
||||
'VPCZoneIdentifier' => nil
|
||||
}.merge!(options)
|
||||
|
||||
|
|
|
@ -81,7 +81,8 @@ class AWS
|
|||
'MinSize' => Integer,
|
||||
'PlacementGroup' => Fog::Nullable::String,
|
||||
'SuspendedProcesses' => [SUSPENDED_PROCESS],
|
||||
'VPCZoneIdentifier' => Fog::Nullable::String
|
||||
'VPCZoneIdentifier' => Fog::Nullable::String,
|
||||
'TerminationPolicies' => [String]
|
||||
}
|
||||
|
||||
AUTO_SCALING_INSTANCE_DETAILS = INSTANCE.merge({
|
||||
|
|
Loading…
Add table
Reference in a new issue