summaryrefslogtreecommitdiffstats
path: root/storage/partitioning.py
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2010-04-22 15:52:05 -0500
committerDavid Lehman <dlehman@redhat.com>2010-04-22 17:58:01 -0500
commitc69c3abc59deebc30b4ff2de4df40929c9739cfe (patch)
tree8c1bdd0a41f1b3f04fa124ba270f44741db26b7f /storage/partitioning.py
parente8727a62c3edaaece42668affe13fb995b4d5dc5 (diff)
downloadanaconda-c69c3abc59deebc30b4ff2de4df40929c9739cfe.tar.gz
anaconda-c69c3abc59deebc30b4ff2de4df40929c9739cfe.tar.xz
anaconda-c69c3abc59deebc30b4ff2de4df40929c9739cfe.zip
Schedule actions when removing existing extended partitions. (#568219)
If removing an extended partition that we created ourselves, we only need to remove the device from the tree. If the device is preexisting we need a destroy action to remove it, even if its removal was not explicitly requested.
Diffstat (limited to 'storage/partitioning.py')
-rw-r--r--storage/partitioning.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/storage/partitioning.py b/storage/partitioning.py
index 9281ecb56..c50dd0cd2 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -846,15 +846,21 @@ def doPartitioning(storage, exclusiveDisks=None):
# remove any obsolete extended partitions
for part in storage.partitions:
if part.disk == disk and part.isExtended:
- storage.devicetree._removeDevice(part, moddisk=False)
+ if part.exists:
+ storage.destroyDevice(part)
+ else:
+ storage.devicetree._removeDevice(part, moddisk=False)
continue
extendedName = devicePathToName(extended.getDeviceNodeName())
# remove any obsolete extended partitions
for part in storage.partitions:
if part.disk == disk and part.isExtended and \
- part.name != extendedName:
- storage.devicetree._removeDevice(part, moddisk=False)
+ part.partedPartition not in disk.format.partitions:
+ if part.exists:
+ storage.destroyDevice(part)
+ else:
+ storage.devicetree._removeDevice(part, moddisk=False)
device = storage.devicetree.getDeviceByName(extendedName)
if device: