[anaconda:master 3/3] Allow lookup of any raid level in _validate_mountpoint()

mulhern amulhern at redhat.com
Tue May 6 17:05:02 UTC 2014


Previously lookup was restricted to levels allowed by mdraid.

Also, if this level is not restricted to mdraid, it is better to
name it something else.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 pyanaconda/ui/gui/spokes/custom.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index d641d92..3f9deff 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -60,7 +60,7 @@ from blivet.errors import NotEnoughFreeSpaceError
 from blivet.errors import SanityError
 from blivet.errors import SanityWarning
 from blivet.errors import LUKSDeviceWithoutKeyError
-from blivet.devicelibs import mdraid
+from blivet.devicelibs import raid
 from blivet.devices import LUKSDevice
 
 from pyanaconda.storage_utils import get_supported_raid_levels, ui_storage_logger, device_type_from_autopart
@@ -626,11 +626,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
         elif device_type == DEVICE_TYPE_MD and raid_level in (None, "single"):
             error = _("Devices of type %s require a valid RAID level selection.") % _(DEVICE_TEXT_MD)
 
-        if not error and raid_level not in (None, "single"):
-            md_level = mdraid.RAID_levels.raidLevel(raid_level)
-            min_disks = md_level.min_members
+        if not error and raid_level is not None:
+            level_obj = raid.ALL_LEVELS.raidLevel(raid_level)
+            min_disks = level_obj.min_members
             if len(self._device_disks) < min_disks:
-                error = _(RAID_NOT_ENOUGH_DISKS) % {"level": md_level,
+                error = _(RAID_NOT_ENOUGH_DISKS) % {"level": level_obj,
                                                     "min" : min_disks,
                                                     "count": len(self._device_disks)}
 
-- 
1.8.3.1



More information about the anaconda-patches mailing list