diff options
| author | Ales Kozumplik <akozumpl@redhat.com> | 2011-06-17 16:15:21 +0200 |
|---|---|---|
| committer | Ales Kozumplik <akozumpl@redhat.com> | 2011-07-25 14:16:26 +0200 |
| commit | 422194357976b0f4e4b7d3c02615a6628bd7617a (patch) | |
| tree | 56304e1ade77c8980d46f4baea8dfe23e0f6e17d | |
| parent | 8b6d7f89c7e90a33fc7c451f7a4be35d742d8979 (diff) | |
| download | anaconda-422194357976b0f4e4b7d3c02615a6628bd7617a.tar.gz anaconda-422194357976b0f4e4b7d3c02615a6628bd7617a.tar.xz anaconda-422194357976b0f4e4b7d3c02615a6628bd7617a.zip | |
Do not traceback on mpath errors caused by faulty hardware.
Resolves: rhbz#689520
| -rw-r--r-- | pyanaconda/exception.py | 8 | ||||
| -rw-r--r-- | pyanaconda/installinterfacebase.py | 11 | ||||
| -rw-r--r-- | pyanaconda/storage/devices.py | 2 | ||||
| -rw-r--r-- | pyanaconda/storage/errors.py | 4 |
4 files changed, 23 insertions, 2 deletions
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py index 7893202d9..016e9f3ab 100644 --- a/pyanaconda/exception.py +++ b/pyanaconda/exception.py @@ -30,11 +30,19 @@ import shutil import signal from flags import flags import kickstart +import storage.errors import logging log = logging.getLogger("anaconda") class AnacondaExceptionHandler(ExceptionHandler): + def handleException(self, (ty, value, tb), obj): + if issubclass(ty, storage.errors.StorageError) and value.hardware_fault: + self.intf.hardwareError(value) + else: + super(AnacondaExceptionHandler, self).handleException((ty, value, tb), + obj) + def postWriteHook(self, (ty, value, tb), anaconda): # See if /mnt/sysimage is present and put exception there as well if os.access("/mnt/sysimage/root", os.X_OK): diff --git a/pyanaconda/installinterfacebase.py b/pyanaconda/installinterfacebase.py index a34ae2630..b0b8d9343 100644 --- a/pyanaconda/installinterfacebase.py +++ b/pyanaconda/installinterfacebase.py @@ -197,6 +197,17 @@ class InstallInterfaceBase(object): custom_buttons=buttons, expanded=True) + def hardwareError(self, exception): + text=_("The installation was stopped due to what seems to be a problem " + "with your hardware. The exact error message is:\n\n%s.\n\n " + "The installer will now terminate.") % str(exception) + self.messageWindow(title=_("Hardware Error Encountered"), + text=text, + type="custom", + custom_icon="error", + custom_buttons=[_("_Exit installer")]) + sys.exit(0) + def unsupported_steps(self): """ List of steps this interface is unable to carry out. """ return [] diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py index 6e702e75b..0ac9aa4a3 100644 --- a/pyanaconda/storage/devices.py +++ b/pyanaconda/storage/devices.py @@ -3340,7 +3340,7 @@ class MultipathDevice(DMDevice): stderr = "/dev/tty5") if rc: raise MPathError("multipath activation failed for '%s'" % - self.name) + self.name, hardware_fault=True) def _postSetup(self): StorageDevice._postSetup(self) diff --git a/pyanaconda/storage/errors.py b/pyanaconda/storage/errors.py index c3756f6e0..ea7f91d88 100644 --- a/pyanaconda/storage/errors.py +++ b/pyanaconda/storage/errors.py @@ -21,7 +21,9 @@ # class StorageError(Exception): - pass + def __init__(self, *args, **kwargs): + self.hardware_fault = kwargs.pop("hardware_fault", False) + super(StorageError, self).__init__(*args, **kwargs) # Device class DeviceError(StorageError): |
