[master/rhel7-branch] Error gracefully if we have a question in cmdline mode. (#869731)

Samantha N. Bueno sbueno+anaconda at redhat.com
Tue Jan 7 16:58:46 UTC 2014


Show a nice error message before bailing instead of just crashing.

Resolves: rhbz#869731
---
 pyanaconda/exception.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index a32f318..59ebbb6 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -90,6 +90,19 @@ class AnacondaExceptionHandler(ExceptionHandler):
                              "The installer will now terminate.") % str(value)
             self.intf.messageWindow(_("Hardware error occured"), hw_error_msg)
             sys.exit(0)
+        elif (issubclass (ty, RuntimeError) and not flags.flags.ksprompt):
+
+            cmdline_error_msg = _("\nThe installation was stopped due to "
+                                  "incomplete spokes detected while running "
+                                  "in non-interactive cmdline mode. Since there "
+                                  "can not be any questions in cmdline mode, "
+                                  "edit your kickstart file and retry "
+                                  "installation.\nThe exact error message is: "
+                                  "\n\n%s.\n\nThe installer will now terminate.") % str(value)
+            print cmdline_error_msg
+            # sleep for a bit so the error message has a chance of being seen
+            time.sleep(10)
+            sys.exit(0)
         else:
             try:
                 # pylint: disable-msg=E0611
-- 
1.8.3.1



More information about the anaconda-patches mailing list