[PATCH 2/2] Raise an error when an md dev is not in the tree after scanning all slaves

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

 



As the comment already indicates when this happens something is seriously
wrong. I've seen this code get triggered one or 2 times with BIOS RAID and
in both cases the cause was a bug elsewhere in anaconda. So rather then
the current "just wing it" solution, just raise an exception when this
happens.
---
 pyanaconda/storage/devicetree.py |   20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 8ee8671..7b6da53 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -1069,24 +1069,8 @@ class DeviceTree(object):
         # something must be wrong -- if all of the slaves we in
         # the tree, this device should be as well
         if device is None:
-            log.warning("using MD RAID device for %s" % name)
-            try:
-                # level is reported as, eg: "raid1"
-                md_level = udev_device_get_md_level(info)
-                md_devices = int(udev_device_get_md_devices(info))
-                md_uuid = udev_device_get_md_uuid(info)
-            except (KeyError, IndexError, ValueError) as e:
-                log.warning("invalid data for %s: %s" % (name, e))
-                return
-
-            device = MDRaidArrayDevice(name,
-                                       level=md_level,
-                                       memberDevices=md_devices,
-                                       uuid=md_uuid,
-                                       exists=True,
-                                       parents=slaves)
-            self._addDevice(device)
-
+            raise DeviceTreeError("MD RAID device %s not in devicetree after "
+                                  "scanning all slaves" % name)
         return device
 
     def addUdevPartitionDevice(self, info, disk=None):
-- 
1.7.0.1

_______________________________________________
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