summaryrefslogtreecommitdiff
path: root/scripts/lib/wic/kickstart
diff options
context:
space:
mode:
authorMaciej Borzecki <maciej.borzecki@open-rnd.pl>2015-02-04 11:53:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-07 13:34:17 +0000
commit0aa1221c16e65b3daac4aa9a9cfe1d5e9e6106c0 (patch)
tree79ad594b5b70a89be5efe6f3c5b005a0c82f686c /scripts/lib/wic/kickstart
parent24f02c8d1313a423cf219270a9aa55bccbe1893c (diff)
downloadopenembedded-core-0aa1221c16e65b3daac4aa9a9cfe1d5e9e6106c0.tar.gz
openembedded-core-0aa1221c16e65b3daac4aa9a9cfe1d5e9e6106c0.tar.bz2
openembedded-core-0aa1221c16e65b3daac4aa9a9cfe1d5e9e6106c0.zip
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. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/lib/wic/kickstart')
-rw-r--r--scripts/lib/wic/kickstart/__init__.py9
1 files changed, 3 insertions, 6 deletions
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