summaryrefslogtreecommitdiffstats
path: root/scripts/lib
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-08 08:00:26 +0000
commit09fba50cf39002fdc90e738818a418f814713e3a (patch)
tree958097d32e2392eb8d9ee02bdab9ef242ee39de4 /scripts/lib
parent24ffda5438fcb654a351ec5faea46e16d8df7d81 (diff)
downloadpoky-09fba50cf39002fdc90e738818a418f814713e3a.tar.gz
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. (From OE-Core rev: 0aa1221c16e65b3daac4aa9a9cfe1d5e9e6106c0) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-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):
58 def __init__(self): 58 def __init__(self):
59 superclass.__init__(self, mapping=commandMap[using_version]) 59 superclass.__init__(self, mapping=commandMap[using_version])
60 60
61 ks = ksparser.KickstartParser(KSHandlers(), errorsAreFatal=False) 61 ks = ksparser.KickstartParser(KSHandlers(), errorsAreFatal=True)
62 62
63 try: 63 try:
64 ks.readKickstart(path) 64 ks.readKickstart(path)
65 except (kserrors.KickstartParseError, kserrors.KickstartError), err: 65 except (kserrors.KickstartParseError, kserrors.KickstartError), err:
66 if msger.ask("Errors occured on kickstart file, skip and continue?"): 66 msger.warning("Errors occurred when parsing kickstart file: %s\n" % path)
67 msger.warning("%s" % err) 67 msger.error("%s" % err)
68 pass
69 else:
70 raise errors.KsError("%s" % err)
71 68
72 return ks 69 return ks
73 70