summaryrefslogtreecommitdiffstats
path: root/kickstart.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@exeter.boston.redhat.com>2007-11-05 11:23:43 -0500
committerChris Lumens <clumens@exeter.boston.redhat.com>2007-11-05 11:23:43 -0500
commit817e0e790b97064002ea0e9e6b18b98810cf53e7 (patch)
tree0a10ad7bded42f92ea96560a3bce8bb2ec544655 /kickstart.py
parent5b0acf7dd152bc3318abe5b633f08f0c8ef92af4 (diff)
downloadanaconda-817e0e790b97064002ea0e9e6b18b98810cf53e7.tar.gz
anaconda-817e0e790b97064002ea0e9e6b18b98810cf53e7.tar.xz
anaconda-817e0e790b97064002ea0e9e6b18b98810cf53e7.zip
Display more useful error messages on kickstart script errors.
If an error occurs in a kickstart script, display any messages in the message window displayed to the screen. Also display the line number.
Diffstat (limited to 'kickstart.py')
-rw-r--r--kickstart.py33
1 files changed, 25 insertions, 8 deletions
diff --git a/kickstart.py b/kickstart.py
index 7079bddbe..b090e31a1 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -71,17 +71,34 @@ class AnacondaKSScript(Script):
# Always log an error. Only fail if we have a handle on the
# windowing system and the kickstart file included --erroronfail.
if rc != 0:
- log.error("Error code %s encountered running a kickstart %%pre/%%post script", rc)
+ log.error("Error code %s encountered running the kickstart script at line %s" % (rc, self.lineno))
if self.errorOnFail:
if intf != None:
- intf.messageWindow(_("Scriptlet Failure"),
- _("There was an error running the "
- "scriptlet. You may examine the "
- "output in %s. This is a fatal error "
- "and your install will be aborted.\n\n"
- "Press the OK button to exit the "
- "installer.") % (messages,))
+ regularMsg = _("There was an error running the kickstart "
+ "script at line %s. You may examine the "
+ "output in %s. This is a fatal error and "
+ "your install will be aborted. Press the "
+ "OK button to exit the installer.")
+ errorMsg = _("The following error occurred running the "
+ "kickstart script at line %s:\n\n%s\n\nThis "
+ "is a fatal error and your install will be "
+ "aborted. Press the OK button to exit the "
+ "installer.")
+
+ msg = regularMsg % (self.lineno, messages)
+
+ if self.logfile is not None and os.path.isfile(messages):
+ try:
+ f = os.open(messages)
+ err = messages.readlines()
+ os.close(f)
+ msg = errorMsg % (self.lineno, err)
+ except:
+ pass
+
+ intf.messageWindow(_("Scriptlet Failure"), msg)
+
sys.exit(0)
try: