From: mulhern <amulhern(a)redhat.com>
Related: fed#1208536
Should have gone in right after commit
ea0cfad52f86dc589d7e83656e97fa2c1a750fad.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devicetree.py | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index b2688d1..fc026b0 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,13 +1630,24 @@ 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=md_level,
- memberDevices=md_devices,
- uuid=md_uuid,
- metadataVersion=md_metadata,
- exists=True)
+ if raid.getRaidLevel(md_level) 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,
+ metadataVersion=md_metadata,
+ exists=True
+ )
except ValueError as e:
log.error("failed to create md array: %s", e)
return
--
To view this commit on github, visit
https://github.com/rhinstaller/blivet/commit/95b34072aac89cb3234ce880744b...