summaryrefslogtreecommitdiffstats
path: root/partRequests.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-08-14 04:45:09 +0000
committerMike Fulbright <msf@redhat.com>2002-08-14 04:45:09 +0000
commit93aa9ed256c77ac59b19a05d2aefbd3fa39f8efb (patch)
treead3a78c08605b0ac5b256d3973423b8fa36c4d15 /partRequests.py
parentc13a11ffc506b95e1cd410b30257ad618beb6b25 (diff)
downloadanaconda-93aa9ed256c77ac59b19a05d2aefbd3fa39f8efb.tar.gz
anaconda-93aa9ed256c77ac59b19a05d2aefbd3fa39f8efb.tar.xz
anaconda-93aa9ed256c77ac59b19a05d2aefbd3fa39f8efb.zip
clamp sizes to allowable sizes based on Physical Extent of Volume Group
Diffstat (limited to 'partRequests.py')
-rw-r--r--partRequests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/partRequests.py b/partRequests.py
index e87773234..4065d2ece 100644
--- a/partRequests.py
+++ b/partRequests.py
@@ -28,6 +28,7 @@ from rhpl.log import log
import fsset
import raid
+import lvm
import partedUtils
import partIntfHelpers
@@ -703,6 +704,7 @@ class VolumeGroupRequestSpec(RequestSpec):
for pvid in self.physicalVolumes:
pvreq = partitions.getRequestByID(pvid)
size = pvreq.getActualSize(partitions, diskset)
+ size = lvm.clampPVSize(size, self.pesize)
totalspace = totalspace + size
return totalspace
@@ -784,7 +786,10 @@ class LogicalVolumeRequestSpec(RequestSpec):
"""Return the actual size allocated for the request in megabytes."""
if self.percent:
vgreq = partitions.getRequestByID(self.volumeGroup)
- return int(self.percent * 0.01 * vgreq.size)
+ vgsize = vgreq.getActualSize(partitions, diskset)
+ lvsize = int(self.percent * 0.01 * vgsize)
+ lvsize = lvm.clampLVSizeRequest(lvsize, vgreq.pesize)
+ return lvsize
else:
return self.size