[PATCH] Prevent kickstart parsing errors from ending up in boot options (#1060184)

Martin Kolman mkolman at redhat.com
Tue Feb 4 17:20:15 UTC 2014


If errorsAreFatal is set to False, pykickstart only outputs the error
message but does not interrupt parsing. This results in the kickstart
parsing error message being included in the boot options file that is generated
by the parse-kickstart Dracut module.

By setting errorsAreFatal to True, parsing is interrupted on error,
the error message is correctly forwarded to the system log and the boot
options include only output of correctly parsed kickstart commands.

Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
 dracut/parse-kickstart | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 29e6e6f..7f873c0 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -458,7 +458,9 @@ def write_ifcfg(filename, ifcfg):
 def process_kickstart(ksfile):
     handler = DracutHandler()
     handler.ksdevice = os.environ.get('ksdevice')
-    parser = KickstartParser(handler, missingIncludeIsFatal=False, errorsAreFatal=False)
+    # we need to use errorsAreFatal, otherwise kickstart parsing errors
+    # will end up in the output file
+    parser = KickstartParser(handler, missingIncludeIsFatal=False, errorsAreFatal=True)
     log.info("processing kickstart file %s", ksfile)
     processed_file = preprocessKickstart(ksfile)
     try:
-- 
1.8.5.3



More information about the anaconda-patches mailing list