[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] When lookup a PartedDevice also check for _ped.DeviceException (#527699)



The machine in #527699 has one seriously broken disk, this causes
(py)parted to throw a different exception type when looking up the device
this patch catches this exception too (which will result in the disk
being handled as a removeable disk (ie cardreader) with no media present,
causing us to ignore it.
---
 storage/devices.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index c0d8197..4fb1158 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -477,7 +477,7 @@ class StorageDevice(Device):
             # to find a device.
             try:
                 self._partedDevice = parted.Device(path=self.path)
-            except _ped.IOException:
+            except (_ped.IOException, _ped.DeviceException):
                 pass
 
         return self._partedDevice
-- 
1.6.5.rc2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]