summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2009-03-11 17:18:27 -0500
committerDavid Lehman <dlehman@redhat.com>2009-03-11 21:32:34 -0500
commit9e9626be46747052f4346989df4cb8e14fe94ccb (patch)
treedcca612d2f90a4a80e9970a4809f83059c25e9fa /storage
parent2e11711f0e8af8c4b4098d8490751210e64eb6d4 (diff)
downloadanaconda-9e9626be46747052f4346989df4cb8e14fe94ccb.tar.gz
anaconda-9e9626be46747052f4346989df4cb8e14fe94ccb.tar.xz
anaconda-9e9626be46747052f4346989df4cb8e14fe94ccb.zip
Handle the case of removing an unallocated partition from the tree.
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.
Diffstat (limited to 'storage')
-rw-r--r--storage/devicetree.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 976d5d4e5..7288ad12b 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)