summaryrefslogtreecommitdiffstats
path: root/partRequests.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-06-09 02:08:37 +0000
committerJeremy Katz <katzj@redhat.com>2002-06-09 02:08:37 +0000
commit6db380ca5547a61b80ceee6a1effd76fe35124e3 (patch)
tree7c3aea36a2c56884cd53a432684292b90c465583 /partRequests.py
parentab12ab6cfde4c19414d11cd45cf09e68ed4b8d88 (diff)
downloadanaconda-6db380ca5547a61b80ceee6a1effd76fe35124e3.tar.gz
anaconda-6db380ca5547a61b80ceee6a1effd76fe35124e3.tar.xz
anaconda-6db380ca5547a61b80ceee6a1effd76fe35124e3.zip
better handling of percentages for lv.getActualSize() and in printing out the lv
Diffstat (limited to 'partRequests.py')
-rw-r--r--partRequests.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/partRequests.py b/partRequests.py
index 9e5bacbc3..b9ae34333 100644
--- a/partRequests.py
+++ b/partRequests.py
@@ -715,6 +715,11 @@ class LogicalVolumeRequestSpec(RequestSpec):
fsname = self.fstype.getName()
else:
fsname = "None"
+
+ if self.size:
+ size = self.size
+ else:
+ size = "%s%%" %(self.percent,)
str = ("LV Request -- mountpoint: %(mount)s uniqueID: %(id)s\n"
" type: %(fstype)s format: %(format)s badblocks: %(bb)s\n"
@@ -722,7 +727,7 @@ class LogicalVolumeRequestSpec(RequestSpec):
{"mount": self.mountpoint, "id": self.uniqueID,
"fstype": fsname, "format": self.format, "bb": self.badblocks,
"lvname": self.logicalVolumeName, "vgid": self.volumeGroup,
- "size": self.size})
+ "size": size})
return str
def getDevice(self, partitions):
@@ -735,4 +740,8 @@ class LogicalVolumeRequestSpec(RequestSpec):
def getActualSize(self, partitions, diskset):
"""Return the actual size allocated for the request in megabytes."""
- return self.size
+ if self.percent:
+ vgreq = partitions.getRequestByID(self.volumeGroup)
+ return int(self.percent * 0.01 * vgreq.size)
+ else:
+ return self.size