1
0
Fork 0
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:
Frederick Cheung 2012-09-02 13:43:29 +01:00
parent 444a254bbe
commit 9f909e61dc

View file

@ -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 "