[PATCH] The delete button on a disk only removes partitions. (#496630)

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

 



This may not be the way it should be, but it's the way it is.
---
 partIntfHelpers.py |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/partIntfHelpers.py b/partIntfHelpers.py
index bd1ddbb..6de6e37 100644
--- a/partIntfHelpers.py
+++ b/partIntfHelpers.py
@@ -151,17 +151,24 @@ def doDeleteDependentDevices(intf, storage, device, confirm=1, quiet=0):
 	if not rc:
 	    return False
 
-    deps = storage.deviceDeps(device)
-    if not deps:
+    partitions = [p for p in storage.partitions if p.disk == device]
+    if not partitions:
         # nothing to do
         return False
 
     immutable = []
-    for dep in deps:
-        if storage.deviceImmutable(dep):
+    for dep in partitions:
+        if storage.deviceImmutable(dep) is not False:
             immutable.append(dep.path)
             continue
         else:
+            if dep.format.type == "luks":
+                try:
+                    luksdev = storage.devicetree.getChildren(dep)[0]
+                except IndexError:
+                    pass
+                else:
+                    storage.destroyDevice(luksdev)
             storage.destroyDevice(dep)
 
     if immutable and not quiet:
-- 
1.6.0.6

_______________________________________________
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