[PATCH] Don't try to multipath CD devices. (#516362)

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

 



CD devices obviously aren't multipath devices, but right now the code
allows them to be, because udev_device_is_disk() returns True for a CD
device.  This patch makes that not the case, and also excludes disks
that don't report a serial number.
---
 storage/devicetree.py |    3 ++-
 storage/udev.py       |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 0dec5e0..12d4925 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1780,7 +1780,8 @@ class DeviceTree(object):
         non_disk_devices = {}
         for d in devices:
             serial = udev_device_get_serial(d)
-            if not udev_device_is_disk(d):
+            if (not udev_device_is_disk(d)) or \
+                    (not d.has_key['ID_SERIAL_SHORT']):
                 non_disk_devices.setdefault(serial, [])
                 non_disk_devices[serial].append(d)
                 log.info("adding %s to non_disk_device list" % (d['name'],))
diff --git a/storage/udev.py b/storage/udev.py
index a8024dd..2d199df 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -155,6 +155,8 @@ def udev_device_is_cdrom(info):
 
 def udev_device_is_disk(info):
     """ Return True is the device is a disk. """
+    if udev_device_is_cdrom(info):
+        return False
     has_range = os.path.exists("/sys/%s/range" % info['sysfs_path'])
     return info.get("DEVTYPE") == "disk" or has_range
 
-- 
1.6.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux