[rhel6-branch][v3][PATCH] Don't traceback due to unpartitioned devices (#1007683)

Martin Kolman mkolman at redhat.com
Wed Oct 16 15:50:33 UTC 2013


Disable the create dialog if an unpartitioned device is selected
in the tree view. If no device is selected, check all detected devices
and disable the create dialog if there are no partitioned devices.

Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
 iw/partition_gui.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 3751c5e..1cc3367 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -1346,7 +1346,21 @@ class PartitionWindow(InstallWindow):
         # First we must decide what parts of the create_storage_dialog
         # we will activate.
 
+        # get the currently selected device
+        device = self.tree.getCurrentDevice()
+
+        # check if the current device is partitioned,
+        # if it isn't, we don't support it
         activate_create_partition = True
+        if device:
+            # a device is selected in the GUI,
+            # disable the create dialog if it is unpartitioned
+            activate_create_partition = device.partitioned
+        else:
+            # device was not yet selected in the GUI,
+            # check all devices and disable the create dialog
+            # if there are no partitioned devices
+            activate_create_partition = self.storage.partitioned
 
         # We activate the create Volume Group radio button if there is a free
         # partition with a Physical Volume format.
-- 
1.8.3.1



More information about the anaconda-patches mailing list