This only gets hit if there are four preexisting primary partitions on a disk. Also cleaned up the conditionals a bit to improve clarity. --- storage/partitioning.py | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/storage/partitioning.py b/storage/partitioning.py index e44d7f4..18b5ff3 100644 --- a/storage/partitioning.py +++ b/storage/partitioning.py @@ -440,13 +440,15 @@ def getNextPartitionType(disk, no_primary=None): max_logicals = disk.getMaxLogicalPartitions() primary_count = disk.primaryPartitionCount - if primary_count == disk.maxPrimaryPartitionCount and \ - extended and logical_count < max_logicals: - part_type = parted.PARTITION_LOGICAL - elif primary_count == (disk.maxPrimaryPartitionCount - 1) and \ - not extended and supports_extended: - # last chance to create an extended partition - part_type = parted.PARTITION_EXTENDED + if primary_count >= disk.maxPrimaryPartitionCount - 1: + if extended and logical_count < max_logicals: + part_type = parted.PARTITION_LOGICAL + elif not extended and supports_extended: + # last chance to create an extended partition + part_type = parted.PARTITION_EXTENDED + elif primary_count < disk.maxPrimaryPartitionCount and not no_primary: + # it's either a primary or nothing + part_type = parted.PARTITION_NORMAL elif no_primary and extended and logical_count < max_logicals: # create a logical even though we could presumably create a # primary instead -- 1.6.0.6 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list