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>
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