Re: [PATCH] Handle the case of removing an unallocated partition from the tree.

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

 



Looks good.

On 03/11/2009 12:34 PM, David Lehman wrote:
This was causing a traceback after clicking "ok" on the dialog
stating that partition allocation failed due to insufficient
free space, adding insult to injury.
---
  storage/devicetree.py |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 976d5d4..7288ad1 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -644,7 +644,9 @@ class DeviceTree(object):
              raise ValueError("Cannot remove non-leaf device '%s'" % dev.name)

          # if this is a partition we need to remove it from the parted.Disk
-        if isinstance(dev, PartitionDevice):
+        if isinstance(dev, PartitionDevice) and dev.disk is not None:
+            # if this partition hasn't been allocated it could not have
+            # a disk attribute
              dev.disk.partedDisk.removePartition(dev.partedPartition)

          self._devices.remove(dev)


--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
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