[PATCH 4/4] When deallocating a partition also set its disk attribute to None

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

 



---
 storage/devices.py      |    7 +++++--
 storage/partitioning.py |    1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index e981e7a..080cd7f 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -1274,8 +1274,11 @@ class PartitionDevice(StorageDevice):
         if self.disk:
             self.disk.removeChild()
 
-        self.parents = [disk]
-        disk.addChild()
+        if disk:
+            self.parents = [disk]
+            disk.addChild()
+        else:
+            self.parents = []
 
     disk = property(lambda p: p._getDisk(), lambda p,d: p._setDisk(d))
 
diff --git a/storage/partitioning.py b/storage/partitioning.py
index e8fee31..bf596e1 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -633,6 +633,7 @@ def allocatePartitions(disks, partitions):
 
             partedDisk.removePartition(_part.partedPartition)
             _part.partedPartition = None
+            _part.disk = None
 
             # remove empty extended so it doesn't interfere
             extended = partedDisk.getExtendedPartition()
-- 
1.6.2

_______________________________________________
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