[PATCH 12/47] Removed partedUtils.get_primary_partitions()

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

 



Now provided by parted.Disk.getPrimaryPartitions()
---
 autopart.py    |    4 ++--
 partedUtils.py |    5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/autopart.py b/autopart.py
index c169f1e..283367d 100644
--- a/autopart.py
+++ b/autopart.py
@@ -160,7 +160,7 @@ def findFreespace(diskset):
 
 
 def bestPartType(disk, request):
-    numPrimary = len(partedUtils.get_primary_partitions(disk))
+    numPrimary = len(disk.getPrimaryPartitions())
     maxPrimary = disk.max_primary_partition_count
     if numPrimary == maxPrimary:
         raise PartitioningError, "Unable to create additional primary partitions on /dev/%s" % (disk.dev.path[5:])
@@ -357,7 +357,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None):
                     break
 ##               print("Trying drive", drive)
                 disk = diskset.disks[drive]
-                numPrimary = len(partedUtils.get_primary_partitions(disk))
+                numPrimary = len(disk.getPrimaryPartitions())
                 numLogical = len(disk.getLogicalPartitions())
 
                 # if there is an extended partition add it in
diff --git a/partedUtils.py b/partedUtils.py
index a201c31..245b933 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -159,11 +159,6 @@ def filter_partitions(disk, func):
 
     return rc
 
-def get_primary_partitions(disk):
-    """Return a list of primary PedPartition objects on disk."""
-    func = lambda part: part.type == parted.PARTITION_PRIMARY
-    return filter_partitions(disk, func)
-
 def get_raid_partitions(disk):
     """Return a list of RAID-type PedPartition objects on disk."""
     func = lambda part: (part.is_active()
-- 
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