summaryrefslogtreecommitdiffstats
path: root/storage/devicetree.py
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2010-04-14 20:49:43 -0500
committerDavid Lehman <dlehman@redhat.com>2010-04-15 10:44:05 -0500
commit46743ff2b021b3d9b3a2645fe6f2153f3891a9d2 (patch)
treef89e6f108d32f3b9961f621563f1dd27b0ad445c /storage/devicetree.py
parent2d800b9e470d0a93d9cc923a457bfb25c336cee9 (diff)
downloadanaconda-46743ff2b021b3d9b3a2645fe6f2153f3891a9d2.tar.gz
anaconda-46743ff2b021b3d9b3a2645fe6f2153f3891a9d2.tar.xz
anaconda-46743ff2b021b3d9b3a2645fe6f2153f3891a9d2.zip
Add proper support for destruction of disklabels.
With this patch we can destroy a disklabel of one type and then create a disklabel of a different type in the process of partitioning.
Diffstat (limited to 'storage/devicetree.py')
-rw-r--r--storage/devicetree.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 75dde9c58..c96bfbdd6 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -627,16 +627,20 @@ class DeviceTree(object):
for device in self.devices:
if device.partitioned:
device.format.resetPartedDisk()
+ if device.originalFormat.type == "disklabel" and \
+ device.originalFormat != device.format:
+ device.originalFormat.resetPartedDisk()
# reget parted.Partition for remaining preexisting devices
for device in self.devices:
- if isinstance(device, PartitionDevice):
- p = device.partedPartition
+ if isinstance(device, PartitionDevice) and device.exists:
+ device.resetPartedPartition()
# reget parted.Partition for existing devices we're removing
for action in self._actions:
- if isinstance(action.device, PartitionDevice):
- p = action.device.partedPartition
+ if isinstance(action.device, PartitionDevice) and \
+ action.device.exists:
+ action.device.resetPartedPartition()
# setup actions to create any extended partitions we added
#