summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-05-07 15:18:53 -0400
committerChris Lumens <clumens@redhat.com>2009-05-07 18:59:37 -0400
commitccf469e79699c3cf85ea35cdafe9998d1ee05f5e (patch)
tree2e07122f73bd759a2291a8b13fe4a10fc9962d8d /iw
parent80c9f86a4356616d9d9e551bb32bd9ad3429977b (diff)
downloadanaconda-ccf469e79699c3cf85ea35cdafe9998d1ee05f5e.tar.gz
anaconda-ccf469e79699c3cf85ea35cdafe9998d1ee05f5e.tar.xz
anaconda-ccf469e79699c3cf85ea35cdafe9998d1ee05f5e.zip
Don't traceback when a freespace partition is present (#499662).
This does not allow you to click on a freespace slice in the graph and then edit, new, delete, etc. but it does prevent tracebacks. One step at a time.
Diffstat (limited to 'iw')
-rw-r--r--iw/partition_gui.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 9907ae865..9968f07e5 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -180,12 +180,19 @@ class DiskStripeSlice:
def __init__(self, parent, partition, treeView, editCB):
self.text = None
self.partition = partition
- self.partedPartition = partition.partedPartition
self.parent = parent
self.treeView = treeView
self.editCB = editCB
pgroup = parent.getGroup()
+ # Slices representing freespace are passed a pyparted object as
+ # partition, not an anaconda storage object. Therefore, they do
+ # not have a partedPartition attribute.
+ if self.partition and hasattr(self.partition, "partedPartition"):
+ self.partedPartition = self.partition.partedPartition
+ else:
+ self.partedPartition = self.partition
+
self.group = pgroup.add(gnomecanvas.CanvasGroup)
self.box = self.group.add(gnomecanvas.CanvasRect)
self.group.connect("event", self.eventHandler)
@@ -816,7 +823,13 @@ class PartitionWindow(InstallWindow):
part = part.nextPartition()
continue
- stripe.add(device)
+ # If this is a freespace "partition", there's no device so
+ # don't add it.
+ if device:
+ stripe.add(device)
+ else:
+ stripe.add(part)
+
if device and device.isExtended:
if extendedParent:
raise RuntimeError, ("can't handle more than "