[PATCH 2/3] Schedule actions when removing existing extended partitions. (#568219)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 storage/partitioning.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 887ecbb..62e338e 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -812,15 +812,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:
-- 
1.6.2.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux