[PATCH 4/4] Stop executing command sequences on demand

Jan Tluka jtluka at redhat.com
Wed Aug 15 12:59:01 UTC 2012


Signed-off-by: Jan Tluka <jtluka at redhat.com>
---
 NetTest/NetTestController.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 27cf455..55c5b83 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -369,17 +369,21 @@ class NetTestController:
             raise err
 
     def _run_recipe(self):
+        overall_res = True
+
         for sequence in self._recipe["sequences"]:
             res = self._run_command_sequence(sequence)
 
             for machine_id in self._recipe["machines"]:
                 self._restore_system_config(machine_id)
 
-            # stop when sequence fails
+            # sequence failed, check if we should quit_on_fail
             if not res:
-                break
+                overall_res = False
+                if sequence["quit_on_fail"] == "yes":
+                    break
 
-        return res
+        return overall_res
 
     def _start_packet_capture(self):
         logging.info("Starting packet capture")
-- 
1.7.6.5



More information about the LNST-developers mailing list