summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2001-07-11 03:02:35 +0000
committerJeremy Katz <katzj@redhat.com>2001-07-11 03:02:35 +0000
commit5210d62a012cc1e8e881732a863578d385175f67 (patch)
treeb3af51e3546772762c1027def302b2341bbca1e9 /autopart.py
parent3f04b3fedfdb6b3b7035ae47c610a6f871f33830 (diff)
downloadanaconda-5210d62a012cc1e8e881732a863578d385175f67.tar.gz
anaconda-5210d62a012cc1e8e881732a863578d385175f67.tar.xz
anaconda-5210d62a012cc1e8e881732a863578d385175f67.zip
not all partition tables are limited to only 4 primary partitions...
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/autopart.py b/autopart.py
index d6f2f894d..76f31ca89 100644
--- a/autopart.py
+++ b/autopart.py
@@ -86,12 +86,13 @@ def findFreespace(diskset):
def bestPartType(disk, request):
numPrimary = len(get_primary_partitions(disk))
- if numPrimary == 4:
+ maxPrimary = disk.max_primary_partition_count
+ if numPrimary == maxPrimary:
# raise an error?
return PARTITION_FAIL
if request.primary:
return parted.PARTITION_PRIMARY
- if numPrimary == 3 and not disk.extended_partition:
+ if (numPrimary == (maxPrimary - 1)) and not disk.extended_partition:
return parted.PARTITION_EXTENDED
return parted.PARTITION_PRIMARY