From: Maciej Borzecki Date: Wed, 4 Feb 2015 10:53:07 +0000 (+0100) Subject: wic: bail out on kickstart parse errors X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=156febe5918fd97c6874089b6a668a46dcdcc1a1;p=openembedded-core.git wic: bail out on kickstart parse errors 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. Change-Id: Iace5723c5faf1f207b55cdf98c849ce92c85c777 Signed-off-by: Maciej Borzecki Signed-off-by: Maciek Borzecki Signed-off-by: Ross Burton Signed-off-by: Richard Purdie Signed-off-by: Otavio Salvador --- diff --git a/scripts/lib/wic/kickstart/__init__.py b/scripts/lib/wic/kickstart/__init__.py index 600098293a..b1406a0457 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