[anaconda:rhel7/master 3/5] Quit on_device_type_changed() if self._current_selector is None (#1076055)

mulhern amulhern at redhat.com
Wed Sep 24 16:27:25 UTC 2014


Related: rhbz#1076055

In theory, this should never happen, because this event should only occur
when somebody changes the device type by means of the GUI and by then,
self._current_selector should be set.

In practice, though, on_device_type_changed() seems to be called more
or less spontaneously by the GUI before any actual device is selected.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 pyanaconda/ui/gui/spokes/custom.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 88e90d4..d855518 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -3021,7 +3021,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
             map(really_hide, [container_label, self._containerCombo, self._modifyContainerButton])
 
     def on_device_type_changed(self, combo):
-        if not self._initialized:
+        # This method has been observed to be called without the user
+        # actually changing the deviceTypeCombo widget.
+        # In this case, self._current_selector is likely to be None,
+        # and the selected device therefore non-existant.
+        if not self._initialized or not self._current_selector:
             return
 
         new_type = self._get_current_device_type()
-- 
1.9.3



More information about the anaconda-patches mailing list