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
|
end
|
||||||
|
|
||||||
def reset_auto_scaling_group
|
def reset_auto_scaling_group
|
||||||
@auto_scaling_group = { 'AvailabilityZones' => [], 'EnabledMetrics' => [], 'Instances' => [], 'LoadBalancerNames' => [], 'SuspendedProcesses' => [] }
|
@auto_scaling_group = { 'AvailabilityZones' => [], 'EnabledMetrics' => [], 'Instances' => [],
|
||||||
|
'LoadBalancerNames' => [], 'SuspendedProcesses' => [], 'TerminationPolicies' => [] }
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset_enabled_metric
|
def reset_enabled_metric
|
||||||
|
@ -43,6 +44,8 @@ module Fog
|
||||||
@in_load_balancer_names = true
|
@in_load_balancer_names = true
|
||||||
when 'SuspendedProcesses'
|
when 'SuspendedProcesses'
|
||||||
@in_suspended_processes = true
|
@in_suspended_processes = true
|
||||||
|
when 'TerminationPolicies'
|
||||||
|
@in_termination_policies = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -62,6 +65,8 @@ module Fog
|
||||||
elsif @in_suspended_processes
|
elsif @in_suspended_processes
|
||||||
@auto_scaling_group['SuspendedProcesses'] << @suspended_process
|
@auto_scaling_group['SuspendedProcesses'] << @suspended_process
|
||||||
reset_suspended_process
|
reset_suspended_process
|
||||||
|
elsif @in_termination_policies
|
||||||
|
@auto_scaling_group['TerminationPolicies'] << value
|
||||||
elsif !@in_instances && !@in_policies
|
elsif !@in_instances && !@in_policies
|
||||||
@results['AutoScalingGroups'] << @auto_scaling_group
|
@results['AutoScalingGroups'] << @auto_scaling_group
|
||||||
reset_auto_scaling_group
|
reset_auto_scaling_group
|
||||||
|
@ -81,6 +86,8 @@ module Fog
|
||||||
else
|
else
|
||||||
@auto_scaling_group[name] = value
|
@auto_scaling_group[name] = value
|
||||||
end
|
end
|
||||||
|
when 'TerminationPolicies'
|
||||||
|
@in_termination_policies = false
|
||||||
|
|
||||||
when 'AvailabilityZone', 'HealthStatus', 'InstanceId', 'LifecycleState'
|
when 'AvailabilityZone', 'HealthStatus', 'InstanceId', 'LifecycleState'
|
||||||
@instance[name] = value
|
@instance[name] = value
|
||||||
|
|
|
@ -98,6 +98,7 @@ module Fog
|
||||||
'MinSize' => min_size,
|
'MinSize' => min_size,
|
||||||
'PlacementGroup' => nil,
|
'PlacementGroup' => nil,
|
||||||
'SuspendedProcesses' => [],
|
'SuspendedProcesses' => [],
|
||||||
|
'TerminationPolicies' => [],
|
||||||
'VPCZoneIdentifier' => nil
|
'VPCZoneIdentifier' => nil
|
||||||
}.merge!(options)
|
}.merge!(options)
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,8 @@ class AWS
|
||||||
'MinSize' => Integer,
|
'MinSize' => Integer,
|
||||||
'PlacementGroup' => Fog::Nullable::String,
|
'PlacementGroup' => Fog::Nullable::String,
|
||||||
'SuspendedProcesses' => [SUSPENDED_PROCESS],
|
'SuspendedProcesses' => [SUSPENDED_PROCESS],
|
||||||
'VPCZoneIdentifier' => Fog::Nullable::String
|
'VPCZoneIdentifier' => Fog::Nullable::String,
|
||||||
|
'TerminationPolicies' => [String]
|
||||||
}
|
}
|
||||||
|
|
||||||
AUTO_SCALING_INSTANCE_DETAILS = INSTANCE.merge({
|
AUTO_SCALING_INSTANCE_DETAILS = INSTANCE.merge({
|
||||||
|
|
Loading…
Add table
Reference in a new issue