[elbe-devel] [PATCH 2/6] finetuning: add support for FinetuningException

Manuel Traut manut at linutronix.de
Fri Dec 21 10:40:18 CET 2018


On 17:02 Wed 19 Dec     , Torben Hohn wrote:
> Currently finetuning steps might only throw CommandError.
> This does not fit with errors detected in python code.
> Add an Exception type especially for Errors in the python
> finetuning Code, and catch and log them in the finetuning loops.
> 
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
Reviewed-by: Manuel Traut <manut at linutronix.de>

> ---
>  elbepack/finetuning.py | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
> index 00b4c597..57778463 100644
> --- a/elbepack/finetuning.py
> +++ b/elbepack/finetuning.py
> @@ -22,6 +22,10 @@ from elbepack.rpcaptcache import get_rpcaptcache
>  from elbepack.shellhelper import CommandError
>  
>  
> +class FinetuningException(Exception):
> +    pass
> +
> +
>  class FinetuningAction(object):
>  
>      actiondict = {}
> @@ -590,6 +594,9 @@ def do_finetuning(xml, log, buildenv, target):
>              print("Unimplemented finetuning action '%s'" % (i.et.tag))
>          except CommandError:
>              log.printo("Finetuning Error, trying to continue anyways")
> +        except FinetuningException as e:
> +            log.printo("Finetuning Error: %s" % str(e))
> +            log.printo("trying to continue anyways")
>  
>  
>  def do_prj_finetuning(xml, log, buildenv, target, builddir):
> @@ -605,3 +612,6 @@ def do_prj_finetuning(xml, log, buildenv, target, builddir):
>              print("Unimplemented project-finetuning action '%s'" % (i.et.tag))
>          except CommandError:
>              log.printo("ProjectFinetuning Error, trying to continue anyways")
> +        except FinetuningException as e:
> +            log.printo("ProjectFinetuning Error: %s" % e.message)
> +            log.printo("trying to continue anyways")
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel



More information about the elbe-devel mailing list