diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-06-07 05:20:51 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-06-07 05:20:51 +0000 |
commit | ddf139564817a3b0d203136b5448421456a39dac (patch) | |
tree | 27aca243a0b56d3fb6070c18c6bbbd6c531ad38b /partIntfHelpers.py | |
parent | 203944488d72290e911b0d40c700f4d354884c46 (diff) | |
download | anaconda-ddf139564817a3b0d203136b5448421456a39dac.tar.gz anaconda-ddf139564817a3b0d203136b5448421456a39dac.tar.xz anaconda-ddf139564817a3b0d203136b5448421456a39dac.zip |
add support for creating other types of deletes
Diffstat (limited to 'partIntfHelpers.py')
-rw-r--r-- | partIntfHelpers.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/partIntfHelpers.py b/partIntfHelpers.py index 41fc64d3d..6c880857a 100644 --- a/partIntfHelpers.py +++ b/partIntfHelpers.py @@ -172,16 +172,25 @@ def doDeletePartitionByRequest(intf, requestlist, partition): else: return 0 - if request.type == REQUEST_PREEXIST: - # get the drive - drive = partedUtils.get_partition_drive(partition) - - if partition.type & parted.PARTITION_EXTENDED: - requestlist.deleteAllLogicalPartitions(partition) - - delete = partRequests.DeleteSpec(drive, partition.geom.start, - partition.geom.end) - requestlist.addDelete(delete) + if request.getPreExisting(): + if isinstance(request, partRequests.PartitionSpec): + # get the drive + drive = partedUtils.get_partition_drive(partition) + + if partition.type & parted.PARTITION_EXTENDED: + requestlist.deleteAllLogicalPartitions(partition) + + delete = partRequests.DeleteSpec(drive, partition.geom.start, + partition.geom.end) + requestlist.addDelete(delete) + elif isinstance(request, partRequests.LogicalVolumeRequestSpec): + delete = partRequests.deleteLogicalVolumeSpec(request.logicalVolumeName, + request.volumeGroup) + requestlist.addDelete(delete) + elif isinstance(request, partRequests.VolumeGroupRequestSpec): + delete = partRequests.deleteVolumeGroupSpec(request.volumeGroupName) + requestlist.addDelete(delete) + # FIXME: do we need to do anything with preexisting raids? else: # is this a extended partition we made? if partition.type & parted.PARTITION_EXTENDED: requestlist.deleteAllLogicalPartitions(partition) |