mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[HP] delete_if returns the array, not what was deleted
This commit is contained in:
parent
444a254bbe
commit
9f909e61dc
1 changed files with 4 additions and 4 deletions
|
@ -25,14 +25,14 @@ module Fog
|
|||
response = Excon::Response.new
|
||||
|
||||
sg_rule = nil
|
||||
|
||||
self.data[:security_groups].each do |_, sgv|
|
||||
if sgv['rules']
|
||||
sg_rule = sgv['rules'].delete_if { |r| !r.nil? && r['id'] == security_group_rule_id }
|
||||
break if sg_rule
|
||||
sg_rule_index = sgv['rules'].find_index { |r| !r.nil? && r['id'] == security_group_rule_id }
|
||||
if sg_rule_index
|
||||
sg_rule = sgv['rules'].delete_at sg_rule_index
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if sg_rule && !sg_rule.empty?
|
||||
response.status = 202
|
||||
response.body = "202 Accepted\n\nThe request is accepted for processing.\n\n "
|
||||
|
|
Loading…
Add table
Reference in a new issue