summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2001-07-06 04:38:07 +0000
committerJeremy Katz <katzj@redhat.com>2001-07-06 04:38:07 +0000
commite9c79a0f665953a809b70fe9be238314f1e6d4e2 (patch)
treee803b8eb3400a6b5de56313f7aaf32a60b2e29e1 /autopart.py
parent30af411e6adab18c49fbef05c180ada1b7fcd93f (diff)
downloadanaconda-e9c79a0f665953a809b70fe9be238314f1e6d4e2.tar.gz
anaconda-e9c79a0f665953a809b70fe9be238314f1e6d4e2.tar.xz
anaconda-e9c79a0f665953a809b70fe9be238314f1e6d4e2.zip
fix the add one, get many case
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/autopart.py b/autopart.py
index 7de52d244..4e0d9ec2b 100644
--- a/autopart.py
+++ b/autopart.py
@@ -107,6 +107,12 @@ class partlist:
return retval
+ def reset(self):
+ for part in self.parts:
+ self.parts.remove(part)
+ del part
+ self.parts = []
+
# first step of partitioning voodoo
# partitions with a specific start and end cylinder requested are
@@ -304,7 +310,6 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None):
request.device = fsset.PartedPartitionDevice(newp).getDevice()
drive = newp.geom.disk.dev.path[5:]
request.currentDrive = drive
-
newParts.parts.append(newp)
free = findFreespace(diskset)
@@ -574,12 +579,10 @@ def processPartitioning(diskset, requests, newParts):
# the disks. We'll start again from there.
for part in newParts.parts:
disk = part.geom.disk
- if part.type & parted.PARTITION_LOGICAL:
- del part
- continue
+# disk = diskset.disks[get_partition_drive(part)]
disk.delete_partition(part)
- del part
- newParts.parts = []
+
+ newParts.reset()
for request in requests.requests:
if request.type == REQUEST_NEW:
@@ -656,12 +659,10 @@ def doPartitioning(diskset, requests, doRefresh = 1):
if ret == PARTITION_FAIL:
raise PartitioningError, "Partitioning failed: %s" %(msg)
-
+
ret = growParts(diskset, requests, newParts)
- for part in newParts.parts:
- newParts.parts.remove(part)
- del part
+ newParts.reset()
if ret != PARTITION_SUCCESS:
raise PartitioningError, "Growing partitions failed"