[elbe-devel] [PATCH] finetuning: fix unimplemented action error

bage at linutronix.de bage at linutronix.de
Wed Sep 4 23:03:55 CEST 2019


From: Bastian Germann <bage at linutronix.de>

A KeyError might be thrown during action execution, which is the case
for the updated example.

Signed-off-by: Bastian Germann <bage at linutronix.de>
---
 elbepack/finetuning.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index 86a42c14..71875497 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -706,10 +706,12 @@ 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:
-- 
2.20.1




More information about the elbe-devel mailing list