summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2001-06-20 21:21:15 +0000
committerJeremy Katz <katzj@redhat.com>2001-06-20 21:21:15 +0000
commit24842cb76f8fd6120500adeb7c0e26a7cf1b3926 (patch)
treea00547741a8be61aa18202a987657d986f29d0a8 /autopart.py
parent2f5300e6a8d41ec45fc38806d61947518ce32663 (diff)
downloadanaconda-24842cb76f8fd6120500adeb7c0e26a7cf1b3926.tar.gz
anaconda-24842cb76f8fd6120500adeb7c0e26a7cf1b3926.tar.xz
anaconda-24842cb76f8fd6120500adeb7c0e26a7cf1b3926.zip
fix a bug with deleting pre-existing partitions
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/autopart.py b/autopart.py
index 4c009f1c5..4461a3766 100644
--- a/autopart.py
+++ b/autopart.py
@@ -215,6 +215,8 @@ def growParts(diskset, requests):
for part in free[key]:
freeSize[key] = freeSize[key] + getPartSize(part)
+ print freeSize
+
# find growable partitions and find out the size of the growable parts
growable = {}
growSize = {}
@@ -279,6 +281,19 @@ def growParts(diskset, requests):
return PARTITION_SUCCESS
+def setPreexistParts(diskset, requests):
+ for request in requests:
+ if request.type != REQUEST_PREEXIST:
+ continue
+ disk = diskset.disks[request.drive]
+ part = disk.next_partition()
+ while part:
+ if part.geom.start == request.start and part.geom.end == request.end:
+ request.device = get_partition_name(part)
+ break
+ part = disk.next_partition(part)
+
+
def deletePart(diskset, delete):
disk = diskset.disks[delete.drive]
part = disk.next_partition()
@@ -304,7 +319,8 @@ def processPartitioning(diskset, requests):
# XXX - handle delete requests
for delete in requests.deletes:
deletePart(diskset, delete)
-# diskset.deleteAllPartitions()
+
+ setPreexistParts(diskset, requests.requests)
# sort requests by size
requests.sortRequests()