[PATCH] Let the user continue on bootloader errors (#1006304)

Brian C. Lane bcl at redhat.com
Sat May 10 00:15:53 UTC 2014


Sometimes a bootloader failure can be recovered from, let the user
choose whether or not to continue with the rest of the installation.
---
 pyanaconda/bootloader.py |  1 +
 pyanaconda/errors.py     | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index a36f086..98cf92b 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -2391,6 +2391,7 @@ def writeBootLoader(storage, payload, instClass, ksdata):
     try:
         storage.bootloader.write()
     except BootLoaderError as e:
+        log.error("bootloader.write failed: %s", e)
         if errorHandler.cb(e) == ERROR_RAISE:
             raise
 
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
index 5ca0b1f..e434141 100644
--- a/pyanaconda/errors.py
+++ b/pyanaconda/errors.py
@@ -241,6 +241,18 @@ class ErrorHandler(object):
         self.ui.showDetailedError(message, details)
         return ERROR_RAISE
 
+    def _bootLoaderErrorHandler(self, exn):
+        message = _("The following error occurred while installing the bootloader. "
+                    "The system will not be bootable. "
+                    "Would you like to ignore this and continue with "
+                    "installation?")
+        message += "\n\n" + str(exn)
+
+        if self.ui.showYesNoQuestion(message):
+            return ERROR_CONTINUE
+        else:
+            return ERROR_RAISE
+
     def cb(self, exn):
         """This method is the callback that all error handling should pass
            through.  The return value is one of the ERROR_* constants defined
@@ -269,7 +281,8 @@ class ErrorHandler(object):
                 "NoSuchPackage": self._noSuchPackageHandler,
                 "ScriptError": self._scriptErrorHandler,
                 "PayloadInstallError": self._payloadInstallHandler,
-                "DependencyError": self._dependencyErrorHandler}
+                "DependencyError": self._dependencyErrorHandler,
+                "BootLoaderError": self._bootLoaderErrorHandler}
 
         if exn.__class__.__name__ in _map:
             rc = _map[exn.__class__.__name__](exn)
-- 
1.9.0



More information about the anaconda-patches mailing list