mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[AWS|ASG] filter mocked results for describe_auto_scaling_groups
This was causing an issue for me. Because Groups#get uses this method to fetch a single ASG, it was always returning the first ASG in the data set, not the one that actually matched the specified ASG name.
This commit is contained in:
parent
4e2b7c40b5
commit
de27445256
1 changed files with 9 additions and 1 deletions
|
@ -111,7 +111,15 @@ module Fog
|
|||
|
||||
def describe_auto_scaling_groups(options = {})
|
||||
results = { 'AutoScalingGroups' => [] }
|
||||
self.data[:auto_scaling_groups].each do |asg_name, asg_data|
|
||||
asg_set = self.data[:auto_scaling_groups]
|
||||
|
||||
if !options["AutoScalingGroupNames"].nil?
|
||||
asg_set = asg_set.reject do |asg_name, asg_data|
|
||||
![*options["AutoScalingGroupNames"]].include?(asg_name)
|
||||
end
|
||||
end
|
||||
|
||||
asg_set.each do |asg_name, asg_data|
|
||||
results['AutoScalingGroups'] << {
|
||||
'AutoScalingGroupName' => asg_name
|
||||
}.merge!(asg_data)
|
||||
|
|
Loading…
Reference in a new issue