Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Development (http://www.linux-archive.org/fedora-development/)
-   -   Constrain lvmpv, mdmember, and swap partitions to a single disk. (#605756) (http://www.linux-archive.org/fedora-development/390428-constrain-lvmpv-mdmember-swap-partitions-single-disk-605756-a.html)

David Lehman 06-24-2010 06:34 PM

Constrain lvmpv, mdmember, and swap partitions to a single disk. (#605756)
 
---
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=mountpoin t,
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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 09:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.