summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-06-28 20:00:31 +0000
committerJeremy Katz <katzj@redhat.com>2002-06-28 20:00:31 +0000
commite6e41e3dde4ab7ae306297e98d45475309e71e4e (patch)
tree6c9b719b14795cd908a34faa0f6966d66c250112 /autopart.py
parent3f3e3eaf8f05b868ae3fd0cfca801ba53117b0d8 (diff)
downloadanaconda-e6e41e3dde4ab7ae306297e98d45475309e71e4e.tar.gz
anaconda-e6e41e3dde4ab7ae306297e98d45475309e71e4e.tar.xz
anaconda-e6e41e3dde4ab7ae306297e98d45475309e71e4e.zip
check to make sure that the size of our volume group hasn't changed such that logical volumes no longer fit (#?????)
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py31
1 files changed, 26 insertions, 5 deletions
diff --git a/autopart.py b/autopart.py
index 879cd25a3..79a6075df 100644
--- a/autopart.py
+++ b/autopart.py
@@ -755,8 +755,7 @@ def processPartitioning(diskset, requests, newParts):
request.size = request.getActualSize(requests, diskset)
vgreq = requests.getRequestByID(request.volumeGroup)
- return (PARTITION_SUCCESS, "success")
-
+ return (PARTITION_SUCCESS, "success")
## print "disk layout after everything is done"
## print diskset.diskState()
@@ -786,12 +785,34 @@ def doPartitioning(diskset, requests, doRefresh = 1):
raise PartitioningError, "Growing partitions failed"
ret = bootRequestCheck(requests, diskset)
-
+
+ if ret != PARTITION_SUCCESS:
+ # more specific message?
+ raise PartitioningWarning, _("Boot partition %s may not meet booting constraints for your architecture. Creation of a boot disk is highly encouraged.") %(requests.getBootableRequest().mountpoint)
+
+ # make sure our logical volumes still fit
+ vgused = {}
+ for request in requests.requests:
+ if request.type == REQUEST_LV:
+ size = int(request.getActualSize(requests, diskset))
+ if vgused.has_key(request.volumeGroup):
+ vgused[request.volumeGroup] = (vgused[request.volumeGroup] +
+ size)
+ else:
+ vgused[request.volumeGroup] = size
+ for vg in vgused.keys():
+ request = requests.getRequestByID(vg)
+ print vgused[vg]
+ print request.getActualSize(requests, diskset)
+ if vgused[vg] > request.getActualSize(requests, diskset):
+ raise PartitioningError, _("Adding this partition would not "
+ "leave enough disk space for already "
+ "allocated logical volumes in "
+ "%s." % (request.volumeGroupName))
+
if ret == PARTITION_SUCCESS:
return
- # more specific message?
- raise PartitioningWarning, _("Boot partition %s may not meet booting constraints for your architecture. Creation of a boot disk is highly encouraged.") %(requests.getBootableRequest().mountpoint)
# given clearpart specification execute it
# probably want to reset diskset and partition request lists before calling