[OE-core] [PATCH] wic: bail out on kickstart parse errors

Tom Zanussi tom.zanussi at linux.intel.com
Wed Feb 4 15:13:23 UTC 2015


On Wed, 2015-02-04 at 11:53 +0100, Maciej Borzecki wrote:
> Kickstart file errors are not emitted by the parser. In case errors, the
> current code will continue to execute possibly creating a faulty or
> incomplete image. The patch enables the parser to emit all encountered
> errors. The error message is shown for the user and further execution is
> ceased.
> 
> Signed-off-by: Maciej Borzecki <maciej.borzecki at open-rnd.pl>
> Signed-off-by: Maciek Borzecki <maciek.borzecki at gmail.com>

Acked-by: Tom Zanussi <tom.zanussi at linux.intel.com>

> ---
>  scripts/lib/wic/kickstart/__init__.py | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/lib/wic/kickstart/__init__.py b/scripts/lib/wic/kickstart/__init__.py
> index 600098293aeff5a1f7756ba20381b8d054c10fd1..b1406a04575906f7d5822139eef5a4a2753040fc 100644
> --- a/scripts/lib/wic/kickstart/__init__.py
> +++ b/scripts/lib/wic/kickstart/__init__.py
> @@ -58,16 +58,13 @@ def read_kickstart(path):
>          def __init__(self):
>              superclass.__init__(self, mapping=commandMap[using_version])
>  
> -    ks = ksparser.KickstartParser(KSHandlers(), errorsAreFatal=False)
> +    ks = ksparser.KickstartParser(KSHandlers(), errorsAreFatal=True)
>  
>      try:
>          ks.readKickstart(path)
>      except (kserrors.KickstartParseError, kserrors.KickstartError), err:
> -        if msger.ask("Errors occured on kickstart file, skip and continue?"):
> -            msger.warning("%s" % err)
> -            pass
> -        else:
> -            raise errors.KsError("%s" % err)
> +        msger.warning("Errors occurred when parsing kickstart file: %s\n" % path)
> +        msger.error("%s" % err)
>  
>      return ks
>  
> -- 
> 1.9.3
> 





More information about the Openembedded-core mailing list