This needs some work, see below. David Lehman wrote:
This is just some leftovers from the last time I fixed the tracking of the free region and it's containing disk. --- storage/partitioning.py | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/storage/partitioning.py b/storage/partitioning.py index cf151d1..5b9e02b 100644 --- a/storage/partitioning.py +++ b/storage/partitioning.py @@ -653,21 +653,21 @@ def allocatePartitions(disks, partitions): part_type == parted.PARTITION_NORMAL: # see if we can do better with a logical partition log.debug("not enough free space for primary -- trying logical") - part_type = getNextPartitionType(disk, no_primary=True) - if part_type: - free = getBestFreeSpaceRegion(disk, + new_part_type = getNextPartitionType(disk, no_primary=True) + if new_part_type: + best = getBestFreeSpaceRegion(disk, part_type,
I think this should be new_part_type here too. more in general allocatePartitions seems to mix and match part_type and new_part_type, where it should use only one variable for these everywhere.
_part.req_size, best_free=free, boot=_part.req_bootable) - elif best: - if free != best: - # now we know we are choosing a new free space, - # so update the disk and part type - log.debug("updating use_disk to %s (%s), type: %s" - % (_disk, _disk.name, new_part_type)) - part_type = new_part_type - use_disk = _disk + + if best and free != best: + # now we know we are choosing a new free space, + # so update the disk and part type + log.debug("updating use_disk to %s (%s), type: %s" + % (_disk, _disk.name, new_part_type)) + part_type = new_part_type + use_disk = _disk log.debug("new free: %s (%d-%d / %dMB)" % (best, best.start, best.end,
Regards, Hans _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list