[elbe-devel] [PATCH 08/37] elbepack: finetuning.py: exit after exception

Benedikt Spranger b.spranger at linutronix.de
Wed Feb 7 15:28:35 CET 2024


From: Eduard Krein <eduard.krein at linutronix.de>

Instead of trying to continue anyways after a finetuning exception
ELBE instead aborts the building process to save time on a faulty build.
While at it, fix and reword the error messages.

Signed-off-by: Eduard Krein <eduard.krein at linutronix.de>
Signed-off-by: Benedikt Spranger <b.spranger at linutronix.de>
---
 elbepack/finetuning.py | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index 31aed610..26f0e251 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -758,17 +758,17 @@ def do_finetuning(xml, buildenv, target):
     for i in xml.node('target/finetuning'):
         try:
             action = FinetuningAction(i)
+            action.execute(buildenv, target)
         except KeyError:
             logging.exception("Unimplemented finetuning action '%s'",
                               i.et.tag)
-            return
-        try:
-            action.execute(buildenv, target)
-        except CommandError:
-            logging.exception("Finetuning Error, trying to continue anyways")
-        except FinetuningException:
-            logging.exception("Finetuning Error\n"
-                              "Trying to continue anyways")
+            raise
+        except CommandError as e:
+            logging.exception('Finetuning Error: %s', e)
+            raise
+        except FinetuningException as e:
+            logging.exception('Finetuning Error: %s', e)
+            raise
 
 
 def do_prj_finetuning(xml, buildenv, target, builddir):
@@ -781,14 +781,14 @@ def do_prj_finetuning(xml, buildenv, target, builddir):
             action = FinetuningAction(i)
             action.execute_prj(buildenv, target, builddir)
         except KeyError:
-            logging.exception("Unimplemented project-finetuning action '%s'",
+            logging.exception("Unimplemented Project Finetuning action '%s'",
                               i.et.tag)
-        except CommandError:
-            logging.exception("ProjectFinetuning Error, "
-                              "trying to continue anyways")
-        except FinetuningException:
-            logging.exception("Finetuning Error\n"
-                              "Trying to continue anyways")
+        except CommandError as e:
+            logging.exception('Project Finetuning Error: %s', e)
+            raise
+        except FinetuningException as e:
+            logging.exception('Project Finetuning Error: %s', e)
+            raise
         except Exception as e:
             logging.exception(str(e))
             raise
-- 
2.43.0



More information about the elbe-devel mailing list