[lnst] Stop executing command sequences on demand

Jiří Pírko jirka at fedoraproject.org
Thu Aug 16 11:43:28 UTC 2012


commit 92dac8553d5b23eb826b83d4c5345b3c9ac8716e
Author: Jan Tluka <jtluka at redhat.com>
Date:   Wed Aug 15 14:59:01 2012 +0200

    Stop executing command sequences on demand
    
    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 05d7261..c70e252 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -382,17 +382,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")


More information about the LNST-developers mailing list