summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-05-31 04:22:19 +0000
committerJeremy Katz <katzj@redhat.com>2002-05-31 04:22:19 +0000
commit2e58842ca3172343937392a35f41566e34c1755c (patch)
tree54ebd81c773e6a79cb219dc8be67e3801641f42d /autopart.py
parent87a722dab1676eb1e1bb37bcfc866d1f6175789f (diff)
downloadanaconda-2e58842ca3172343937392a35f41566e34c1755c.tar.gz
anaconda-2e58842ca3172343937392a35f41566e34c1755c.tar.xz
anaconda-2e58842ca3172343937392a35f41566e34c1755c.zip
clean up getting of request sizes for lvm and raid to be just the same as
for partitions. clean up the ensuing mess. we also need to use proper sanity checking of requests before doing autopartitioning instead of the hack that was there before.
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py40
1 files changed, 24 insertions, 16 deletions
diff --git a/autopart.py b/autopart.py
index e5224b300..fe772eac7 100644
--- a/autopart.py
+++ b/autopart.py
@@ -740,10 +740,8 @@ def processPartitioning(diskset, requests, newParts):
if request.type == REQUEST_LV and not request.device:
request.device = str(request.uniqueID)
- if request.type == REQUEST_RAID:
- request.size = get_raid_device_size(request, requests, diskset) / 1024 / 1024
- elif request.type == REQUEST_VG:
- request.size = get_lvm_volume_group_size(request, requests, diskset) / 1024 / 1024
+ if request.type == REQUEST_RAID or request.type == REQUEST_VG:
+ request.size = request.getActualSize(requests, diskset)
if not request.device:
# return PARTITION_FAIL
raise PartitioningError, "Unsatisfied partition request\n%s" %(request)
@@ -945,18 +943,15 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch):
partitions.addRequest(req)
# sanity checks for the auto partitioning requests; mostly only useful
- # for kickstart as our installclass defaults SHOULD be sane
- (errors, warnings) = partitions.sanityCheckAllRequests(diskset, 1)
- if warnings:
- for warning in warnings:
- log("WARNING: %s" % (warning))
- if errors:
- errortxt = string.join(errors, '\n')
- intf.messageWindow(_("Partition Request Sanity Check Errors"),
- _("The following errors occurred with your "
- "partitioning:\n\n%s\n\n"
- "Press OK to reboot your system.") % (errortxt))
- sys.exit(0)
+ # for kickstart as our installclass defaults SHOULD be sane
+ for req in partitions.requests:
+ errors = req.sanityCheckRequest(partitions)
+ if errors:
+ intf.messageWindow(_("Partition Request Sanity Check Errors"),
+ _("The following errors occurred with your "
+ "partitioning:\n\n%s\n\n"
+ "Press OK to reboot your system.") %
+ (errors))
try:
doPartitioning(diskset, partitions, doRefresh = 0)
@@ -984,6 +979,19 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch):
if isKickstart:
sys.exit(0)
+ # now do a full check of the requests
+ (errors, warnings) = partitions.sanityCheckAllRequests(diskset)
+ if warnings:
+ for warning in warnings:
+ log("WARNING: %s" % (warning))
+ if errors:
+ errortxt = string.join(errors, '\n')
+ intf.messageWindow(_("Partition Request Sanity Check Errors"),
+ _("The following errors occurred with your "
+ "partitioning:\n\n%s\n\n"
+ "Press OK to reboot your system.") % (errortxt))
+ sys.exit(0)
+
def autoCreatePartitionRequests(autoreq):
"""Return a list of requests created with a shorthand notation.