Skip to content

Commit

Permalink
B #6759: finalise the SG rules on sg rule error (v2)
Browse files Browse the repository at this point in the history
try SG on all nick before raising an error
  • Loading branch information
atodorov-storpool committed Nov 26, 2024
1 parent e18477a commit d1e4734
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/vnm_mad/remotes/lib/sg_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def activate(do_all = false)
end

# Process the rules for each NIC
sg_error = 0
process do |nic|
next if attach_nic_id && attach_nic_id != nic[:nic_id]

Expand All @@ -124,9 +125,8 @@ def activate(do_all = false)
sg.process_rules
sg.run!
rescue StandardError => e
unlock
SGIPTables.nic_post(@vm, nic)
raise e
sg_error = e
break
end
end

Expand All @@ -142,6 +142,10 @@ def activate(do_all = false)

unlock

unless sg_error == 0
raise sg_error
end

0
end

Expand Down

0 comments on commit d1e4734

Please sign in to comment.