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

[PATCH 3/9] Do on-demand scanning of md container if needed. (#678877)



---
 pyanaconda/storage/devicetree.py |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 39a4245..660d4a5 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -828,7 +828,21 @@ class DeviceTree(object):
         elif udev_device_get_md_container(info):
             diskType = MDRaidArrayDevice
             parentName = devicePathToName(udev_device_get_md_container(info))
-            kwargs["parents"] = [ self.getDeviceByName(parentName) ]
+            container = self.getDeviceByName(parentName)
+            if not container:
+                container_sysfs = "/class/block/" + parentName
+                container_info = udev_get_block_device(container_sysfs)
+                if not container_info:
+                    log.error("failed to find md container %s at %s"
+                                % (parentName, container_sysfs))
+                return
+
+                container = self.addUdevDevice(container_info)
+                if not container:
+                    log.error("failed to scan md container %s" % parentName)
+                    return
+
+            kwargs["parents"] = [container]
             kwargs["level"]  = udev_device_get_md_level(info)
             kwargs["memberDevices"] = int(udev_device_get_md_devices(info))
             kwargs["uuid"] = udev_device_get_md_uuid(info)
-- 
1.7.3.5


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