Fabian Deutsch has uploaded a new change for review.

Change subject: Don't crash if there are no boot devices
......................................................................

Don't crash if there are no boot devices

If there are no disks found in the installer, disable the continue
button and properly show the message to the user instead of
crashing because we try to address a label which isn't created.

Change-Id: I9b7329a32b4dc6ff38d31b296deee22360512885
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1084528
Signed-off-by: Ryan Barry <[email protected]>
---
M src/ovirt/node/installer/core/boot_device_page.py
1 file changed, 14 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/44/27144/1

diff --git a/src/ovirt/node/installer/core/boot_device_page.py 
b/src/ovirt/node/installer/core/boot_device_page.py
index e91c5b0..6936c4a 100644
--- a/src/ovirt/node/installer/core/boot_device_page.py
+++ b/src/ovirt/node/installer/core/boot_device_page.py
@@ -88,14 +88,20 @@
 
     def on_change(self, changes):
         self.logger.debug("Boot device changes: %s" % changes)
-        if changes.contains_any(["boot.device"]):
-            device = changes["boot.device"]
-            if device == "other":
-                self.widgets["label.details"].text("")
-            else:
-                changes["boot.device.current"] = device
-                self._model.update(changes)
-                self.widgets["label.details"].set_device(device)
+        devices = self.storage_discovery.all_devices_for_ui_table()
+        if devices:
+            if changes.contains_any(["boot.device"]):
+                device = changes["boot.device"]
+                if device == "other":
+                    self.widgets["label.details"].text("")
+                else:
+                    changes["boot.device.current"] = device
+                    self._model.update(changes)
+                    self.widgets["label.details"].set_device(device)
+        else:
+            # Disable the continue button
+            buttons = plugins.UIElements(self.widgets["boot"].buttons)
+            buttons["button.next"].enabled(False)
 
         if changes.contains_any(["boot.device.custom"]):
             if self.storage_discovery.devices.live_disk_name() == \


-- 
To view, visit http://gerrit.ovirt.org/27144
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b7329a32b4dc6ff38d31b296deee22360512885
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: node-3.0
Gerrit-Owner: Fabian Deutsch <[email protected]>
_______________________________________________
node-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/node-patches

Reply via email to