[elbe-devel] [PATCH 3/3] Fix ValueError in finetuning rm artifact

dion at linutronix.de dion at linutronix.de
Wed Aug 7 15:25:33 CEST 2019


From: Olivier Dion <dion at linutronix.de>

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/finetuning.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index dd037025..0ea082e9 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -511,7 +511,11 @@ class RmArtifactAction(FinetuningAction):
                                   "used in <project-finetuning>")
 
     def execute_prj(self, _log, _buildenv, target, _builddir):
-        target.images.remove(self.node.et.text)
+        try:
+            target.images.remove(self.node.et.text)
+        except ValueError:
+            raise FinetuningException("Artifact %s doesn't exist" %
+                                      self.node.et.text)
 
 
 @FinetuningAction.register('losetup')
-- 
2.11.0




More information about the elbe-devel mailing list