[PATCH 2/5] Constrain lvmpv, mdmember, and swap partitions to a single disk. (#605756)

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

 



---
 pyanaconda/iw/partition_dialog_gui.py     |    7 +++++++
 pyanaconda/iw/partition_ui_helpers_gui.py |   20 ++++++--------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/pyanaconda/iw/partition_dialog_gui.py b/pyanaconda/iw/partition_dialog_gui.py
index 9064af4..5d13d74 100644
--- a/pyanaconda/iw/partition_dialog_gui.py
+++ b/pyanaconda/iw/partition_dialog_gui.py
@@ -185,6 +185,13 @@ class PartitionEditor:
                                 disks.append(disk)
 
                 format = fmt_class(mountpoint=mountpoint)
+
+                err = doUIRAIDLVMChecks(format, disks, self.storage)
+                if err:
+                    self.intf.messageWindow(_("Error With Request"),
+                                            "%s" % err, custom_icon="error")
+                    continue
+
                 weight = self.anaconda.platform.weight(mountpoint=mountpoint,
                                                        fstype=format.type)
                 if self.isNew:
diff --git a/pyanaconda/iw/partition_ui_helpers_gui.py b/pyanaconda/iw/partition_ui_helpers_gui.py
index f38adea..8fa5f6f 100644
--- a/pyanaconda/iw/partition_ui_helpers_gui.py
+++ b/pyanaconda/iw/partition_ui_helpers_gui.py
@@ -427,19 +427,11 @@ def createPreExistFSOptionSection(origrequest, maintable, row, mountCombo,
     return (row, rc)
 
 # do tests we just want in UI for now, not kickstart
-def doUIRAIDLVMChecks(request, storage):
-    fstype = request.format.name
-    numdrives = len(storage.partitioned)
-    
-##     if fstype and fstype.getName() == "physical volume (LVM)":
-## 	if request.grow:
-## 	    return (_("Partitions of type '%s' must be of fixed size, and "
-## 		     "cannot be marked to fill to use available space.")) % (fstype.getName(),)
-
-    if fstype in ["physical volume (LVM)", "software RAID"]:
-	if numdrives > 1 and (not request.req_disks or len(request.req_disks) > 1):
+def doUIRAIDLVMChecks(format, req_disks, storage):
+    if format.type in ["lvmpv", "mdmember", "swap"]:
+	if len(storage.partitioned) > 1 and len(req_disks) != 1:
 	    return (_("Partitions of type '%s' must be constrained to "
 		      "a single drive.  To do this, select the "
-		      "drive in the 'Allowable Drives' checklist.")) % (fstype.getName(),)
-    
-    return None
+		      "drive in the 'Allowable Drives' checklist.")
+                    % format.name)
+
-- 
1.6.6.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