From d1e4734189064497f91656b354d72cdfcf88150c Mon Sep 17 00:00:00 2001 From: Anton Todorov Date: Tue, 26 Nov 2024 13:19:10 +0200 Subject: [PATCH] B #6759: finalise the SG rules on sg rule error (v2) try SG on all nick before raising an error --- src/vnm_mad/remotes/lib/sg_driver.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vnm_mad/remotes/lib/sg_driver.rb b/src/vnm_mad/remotes/lib/sg_driver.rb index 62e3e3cd87..0927178c45 100644 --- a/src/vnm_mad/remotes/lib/sg_driver.rb +++ b/src/vnm_mad/remotes/lib/sg_driver.rb @@ -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] @@ -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 @@ -142,6 +142,10 @@ def activate(do_all = false) unlock + unless sg_error == 0 + raise sg_error + end + 0 end