diff options
author | David Lehman <dlehman@redhat.com> | 2009-03-05 15:54:38 -0600 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-03-05 16:56:47 -0600 |
commit | a0f7a517efb7a9d07560aee4231bb3789c033320 (patch) | |
tree | 7eaa48b96024d2d4c573f5fdcb86abd5b43942d4 /storage/partitioning.py | |
parent | 9219c98bd907a3cfb3acf0daf33cc2715647beef (diff) | |
download | anaconda-a0f7a517efb7a9d07560aee4231bb3789c033320.tar.gz anaconda-a0f7a517efb7a9d07560aee4231bb3789c033320.tar.xz anaconda-a0f7a517efb7a9d07560aee4231bb3789c033320.zip |
Make sure we end up with a disk that matches the chosen free region.
Diffstat (limited to 'storage/partitioning.py')
-rw-r--r-- | storage/partitioning.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/storage/partitioning.py b/storage/partitioning.py index a69751a37..b4f1ce1b7 100644 --- a/storage/partitioning.py +++ b/storage/partitioning.py @@ -588,6 +588,7 @@ def allocatePartitions(disks, partitions): log.debug("allocating partition: %s ; disks: %s ; boot: %s ; primary: %s ; size: %dMB ; grow: %s ; max_size: %s" % (_part.name, req_disks, _part.req_bootable, _part.req_primary, _part.req_size, _part.req_grow, _part.req_max_size)) free = None + use_disk = None # loop through disks for _disk in req_disks: disk = partedDisks[_disk.path] @@ -603,11 +604,14 @@ def allocatePartitions(disks, partitions): log.debug("checking freespace on %s" % _disk.name) - part_type = getNextPartitionType(disk) - if part_type is None: + new_part_type = getNextPartitionType(disk) + if new_part_type is None: # can't allocate any more partitions on this disk log.debug("no free partition slots on %s" % _disk.name) continue + else: + part_type = new_part_type + use_disk = _disk if _part.req_primary and part_type != parted.PARTITION_NORMAL: # we need a primary slot and none are free on this disk @@ -644,6 +648,9 @@ def allocatePartitions(disks, partitions): if free is None: raise PartitioningError("not enough free space on disks") + _disk = use_disk + disk = _disk.partedDisk + # create the extended partition if needed # TODO: move to a function (disk, free) if part_type == parted.PARTITION_EXTENDED: |