diff options
author | David Cantrell <dcantrell@redhat.com> | 2009-02-12 09:07:32 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2009-02-12 11:28:41 -1000 |
commit | 66e1360bb00e290682a61d650400f7a9b425c73f (patch) | |
tree | c6bad0224c443bffc175a7e7c6b3de7679f1738d /autopart.py | |
parent | 7b2590b6d72fc862e669dce4b4a68d9bcf9302c3 (diff) | |
download | anaconda-66e1360bb00e290682a61d650400f7a9b425c73f.tar.gz anaconda-66e1360bb00e290682a61d650400f7a9b425c73f.tar.xz anaconda-66e1360bb00e290682a61d650400f7a9b425c73f.zip |
Removed partedUtils.getPartSizeMB()
The parted.Partition object provides getSize() to return the size
of the partition in a human-readable format.
Diffstat (limited to 'autopart.py')
-rw-r--r-- | autopart.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/autopart.py b/autopart.py index d98af90f7..3f7a35c38 100644 --- a/autopart.py +++ b/autopart.py @@ -119,8 +119,7 @@ def bootAlphaCheckRequirements(part): if free.type & parted.PARTITION_FREESPACE: break free = disk.next_partition(free) - if (not free or free.geom.start != 1L or - partedUtils.getPartSizeMB(free) < 1): + if (not free or free.geom.start != 1L or free.getSize(unit="MB") < 1): return BOOTALPHA_NO_RESERVED_SPACE return PARTITION_SUCCESS @@ -137,7 +136,7 @@ def printNewRequestsCyl(diskset, newRequest): ## partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end))) def printFreespaceitem(part): - return partedUtils.get_partition_name(part), part.geom.start, part.geom.end, partedUtils.getPartSizeMB(part) + return partedUtils.get_partition_name(part), part.geom.start, part.geom.end, part.getSize(unit="MB") def printFreespace(free): print("Free Space Summary:") @@ -180,7 +179,7 @@ class partlist: def __str__(self): retval = "" for p in self.parts: - retval = retval + "\t%s %s %s\n" % (partedUtils.get_partition_name(p), partedUtils.get_partition_file_system_type(p), partedUtils.getPartSizeMB(p)) + retval = retval + "\t%s %s %s\n" % (partedUtils.get_partition_name(p), partedUtils.get_partition_file_system_type(p), p.getSize(unit="MB")) return retval @@ -379,7 +378,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): continue lvmLog.debug( "Trying partition %s" % (printFreespaceitem(part),)) - partSize = partedUtils.getPartSizeMB(part) + partSize = part.getSize(unit="MB") # figure out what the request size will be given the # geometry (#130885) requestSectors = long((request.requestSize * 1024L * 1024L) / part.disk.dev.sector_size) - 1 |