[f22-branch 2/2] Make an MDContainerDevice if that is the right model (#1208536)

mulkieran installerbot-noreply at redhat.com
Thu Apr 2 17:57:43 UTC 2015


From: mulhern <amulhern at redhat.com>

Resolves: fed#1208536

Should have gone in right after commit
ea0cfad52f86dc589d7e83656e97fa2c1a750fad.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/devicetree.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index b2688d1..44b4cde 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -37,6 +37,7 @@
 from .devices import LVMThinPoolDevice, LVMThinLogicalVolumeDevice
 from .devices import LVMSnapShotDevice, LVMThinSnapShotDevice
 from .devices import MDRaidArrayDevice, MDBiosRaidArrayDevice
+from .devices import MDContainerDevice
 from .devices import MultipathDevice, NoDevice, OpticalDevice
 from .devices import PartitionDevice, ZFCPDiskDevice, iScsiDiskDevice
 from .devices import devicePathToName
@@ -46,6 +47,7 @@
 from .formats.fs import nodev_filesystems
 from .devicelibs import lvm
 from .devicelibs import edd
+from .devicelibs import raid
 from . import udev
 from . import util
 from .platform import platform
@@ -1628,8 +1630,17 @@ def handleUdevMDMemberFormat(self, info, device):
                 log.error("failed to determine name for the md array %s", (md_uuid or "unknown"))
                 return
 
+            array_type = MDRaidArrayDevice
             try:
-                md_array = MDRaidArrayDevice(md_name,
+                level_obj = raid.getRaidLevel(md_level)
+                if level_obj is raid.Container and getattr(device.format, "biosraid", False):
+                    array_type = MDContainerDevice
+            except raid.RaidError as e:
+                log.error("failed to create md array: %s", e)
+                return
+
+            try:
+                md_array = array_type(md_name,
                                              level=md_level,
                                              memberDevices=md_devices,
                                              uuid=md_uuid,


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/2357af158ec356744f39e99bf6880de7d4b596c7


More information about the anaconda-patches mailing list