Ryan Barry 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, 13 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/03/26503/1 diff --git a/src/ovirt/node/installer/core/boot_device_page.py b/src/ovirt/node/installer/core/boot_device_page.py index 78e514a..32f567c 100644 --- a/src/ovirt/node/installer/core/boot_device_page.py +++ b/src/ovirt/node/installer/core/boot_device_page.py @@ -89,14 +89,19 @@ 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 + self.widgets["boot"].buttons[2].enabled(False) if changes.contains_any(["boot.device.custom"]): if self.storage_discovery.devices.live_disk_name() == \ -- To view, visit http://gerrit.ovirt.org/26503 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b7329a32b4dc6ff38d31b296deee22360512885 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: master Gerrit-Owner: Ryan Barry <[email protected]> _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
