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

[PATCH] When building the exceptionDisks list, skip devices libparted doesn't like.



libparted does not probe for a lot of devices, notably things like /dev/sr0.
There's no real way to handle this in pyparted since we can't distinguish a
valid but unprobeable device from an invalid device at that layer.  So,
anaconda needs to skip anything libparted refuses to probe.
---
 storage/__init__.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 1b42fbd..1ac6c0d 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -383,7 +383,11 @@ class Storage(object):
             if not device.removable:
                 continue
 
-            dev = parted.Device(path=device.path)
+            try:
+                dev = parted.Device(path=device.path)
+            except parted.DeviceException:
+                continue
+
             disk = parted.Disk(device=dev)
             for part in disk.partitions:
                 if part.active and \
-- 
1.6.1.3


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