diff options
Diffstat (limited to 'iw/partition_gui.py')
-rw-r--r-- | iw/partition_gui.py | 17 |
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 " |