[PATCH 11/16] Fix addUdevDevice so we can actually handle already-in-tree devices.

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

 



Also consolidate addUdevDevice tests for already-in-tree device.
---
 pyanaconda/storage/devicetree.py |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index fbbc2eb..bff53b5 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -864,7 +864,10 @@ class DeviceTree(object):
         #
         # The first step is to either look up or create the device
         #
-        if udev_device_is_multipath_member(info) and device is None:
+        if device:
+            # we successfully looked up the device. skip to format handling.
+            pass
+        elif udev_device_is_multipath_member(info):
             device = self.addUdevDiskDevice(info)
         elif udev_device_is_dm(info) and udev_device_is_dm_mpath(info):
             log.debug("%s is a multipath device" % name)
@@ -872,7 +875,7 @@ class DeviceTree(object):
         elif udev_device_is_dm(info):
             log.debug("%s is a device-mapper device" % name)
             # try to look up the device
-            if device is None and uuid:
+            if uuid:
                 # try to find the device by uuid
                 device = self.getDeviceByUuid(uuid)
 
@@ -880,7 +883,7 @@ class DeviceTree(object):
                 device = self.addUdevDMDevice(info)
         elif udev_device_is_md(info):
             log.debug("%s is an md device" % name)
-            if device is None and uuid:
+            if uuid:
                 # try to find the device by uuid
                 device = self.getDeviceByUuid(uuid)
 
@@ -888,23 +891,19 @@ class DeviceTree(object):
                 device = self.addUdevMDDevice(info)
         elif udev_device_is_cdrom(info):
             log.debug("%s is a cdrom" % name)
-            if device is None:
-                device = self.addUdevOpticalDevice(info)
+            device = self.addUdevOpticalDevice(info)
         elif udev_device_is_biosraid_member(info) and udev_device_is_disk(info):
             log.debug("%s is part of a biosraid" % name)
-            if device is None:
-                device = DiskDevice(name,
-                                major=udev_device_get_major(info),
-                                minor=udev_device_get_minor(info),
-                                sysfsPath=sysfs_path, exists=True)
-                self._addDevice(device)
+            device = DiskDevice(name,
+                            major=udev_device_get_major(info),
+                            minor=udev_device_get_minor(info),
+                            sysfsPath=sysfs_path, exists=True)
+            self._addDevice(device)
         elif udev_device_is_disk(info):
-            if device is None:
-                device = self.addUdevDiskDevice(info)
+            device = self.addUdevDiskDevice(info)
         elif udev_device_is_partition(info):
             log.debug("%s is a partition" % name)
-            if device is None:
-                device = self.addUdevPartitionDevice(info)
+            device = self.addUdevPartitionDevice(info)
         else:
             log.error("Unknown block device type for: %s" % name)
             return
-- 
1.7.3.2

_______________________________________________
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