[PATCH 15/47] Removed partedUtils.getPartSize()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All this function did was return the length of the partition in
sectors, which we already have on the object.  It was called from
one place in autopart.py.  Removed the function and now just
reference the length directly in autopart.py.
---
 autopart.py    |    4 ++--
 partedUtils.py |    4 ----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/autopart.py b/autopart.py
index 283367d..9ad1c4e 100644
--- a/autopart.py
+++ b/autopart.py
@@ -623,7 +623,7 @@ def growParts(diskset, requests, newParts):
             freeSize[key] = 0
             largestFree[key] = 0
             for part in free[key]:
-                sz = partedUtils.getPartSize(part)
+                sz = part.geom.length
                 freeSize[key] += sz
                 if sz > largestFree[key]:
                     largestFree[key] = sz
@@ -738,7 +738,7 @@ def growParts(diskset, requests, newParts):
 
                 # get amount of space actually used by current allocation
                 part = partedUtils.get_partition_by_name(diskset.disks, request.device)
-                startSize = partedUtils.getPartSize(part)
+                startSize = part.geometry.length
 
                 # compute fraction of freespace which to give to this
                 # request. Weight by original request size
diff --git a/partedUtils.py b/partedUtils.py
index 6e04900..e28b3d9 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -48,10 +48,6 @@ log = logging.getLogger("anaconda")
 import gettext
 _ = lambda x: gettext.ldgettext("anaconda", x)
 
-def getPartSize(partition):
-    """Return the size of partition in sectors."""
-    return partition.geom.length
-
 def getMaxAvailPartSizeMB(part):
     """Return the maximum size this partition can grow to by looking
     at contiguous freespace partitions."""
-- 
1.6.1.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux