summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-06-11 04:58:23 +0000
committerJeremy Katz <katzj@redhat.com>2002-06-11 04:58:23 +0000
commitbf78e7a6e550b497be71bf8e539a12c263c84074 (patch)
tree64b9bc093c63620dbd5b1096a0fba8cb6719068d /autopart.py
parent8ab1f11ec4e0aa5899d9078c0415429ef6f06932 (diff)
downloadanaconda-bf78e7a6e550b497be71bf8e539a12c263c84074.tar.gz
anaconda-bf78e7a6e550b497be71bf8e539a12c263c84074.tar.xz
anaconda-bf78e7a6e550b497be71bf8e539a12c263c84074.zip
move autopart.doClearDependentDevices to Partitions().deleteDependentRequests() and fix a few cases that weren't quite handled right
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py34
1 files changed, 1 insertions, 33 deletions
diff --git a/autopart.py b/autopart.py
index 1ca78f771..ea337ce88 100644
--- a/autopart.py
+++ b/autopart.py
@@ -793,38 +793,6 @@ def doPartitioning(diskset, requests, doRefresh = 1):
# more specific message?
raise PartitioningWarning, _("Boot partition %s may not meet booting constraints for your architecture. Creation of a boot disk is highly encouraged.") %(requests.getBootableRequest().mountpoint)
-# remove metadevices (lvm and raid) from partitions which depend on
-# the request which had the given id. to be called from within clearpart
-# NOTE: I am called recursively to handle LVM on top of RAID and LVs in VGs
-def doClearDependentDevices(partitions, id):
- toRemove = []
- for req in partitions.requests:
- if isinstance(req, partRequests.RaidRequestSpec):
- if id in req.raidmembers:
- toRemove.append(req)
- elif isinstance(req, partRequests.VolumeGroupRequestSpec):
- if id in req.physicalVolumes:
- toRemove.append(req)
- delete = partRequests.DeleteVolumeGroupSpec(req.volumeGroupName)
- partitions.addDelete(delete)
- elif isinstance(req, partRequests.LogicalVolumeRequestSpec):
- if id == req.volumeGroup:
- toRemove.append(req)
- tmp = partitions.getRequestByID(req.volumeGroup)
- if not tmp:
- log("Unable to find the vg for %s" (req.logicalVolumeName,))
- vgname = req.volumeGroup
- else:
- vgname = tmp.volumeGroupName
- delete = partRequests.DeleteLogicalVolumeSpec(req.logicalVolumeName,
- vgname)
- partitions.addDelete(delete)
-
- for request in toRemove:
- doClearDependentDevices(partitions, request.uniqueID)
- partitions.removeRequest(request)
-
-
# given clearpart specification execute it
# probably want to reset diskset and partition request lists before calling
# this the first time
@@ -866,7 +834,7 @@ def doClearPartAction(partitions, diskset):
part = disk.next_partition(part)
continue
- doClearDependentDevices(partitions, old.uniqueID)
+ partitions.deleteDependentRequests(old)
partitions.removeRequest(old)
drive = partedUtils.get_partition_drive(part)