[node-patches] Change in ovirt-node[master]: confirmation_page: Add validation for unknown device

dougsland at redhat.com dougsland at redhat.com
Thu Dec 11 14:56:51 UTC 2014


Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: confirmation_page: Add validation for unknown device
......................................................................

confirmation_page: Add validation for unknown device

Currently, we get the details of device before showing the
boot and installation data. However, if there is no data about the
device we should handle it.

Change-Id: If08541192fef9e263436a0c5768d2f9a95ee9b01
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1150878
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M src/ovirt/node/installer/core/confirmation_page.py
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/05/36105/1

diff --git a/src/ovirt/node/installer/core/confirmation_page.py b/src/ovirt/node/installer/core/confirmation_page.py
index 09109d5..88c3638 100644
--- a/src/ovirt/node/installer/core/confirmation_page.py
+++ b/src/ovirt/node/installer/core/confirmation_page.py
@@ -141,9 +141,13 @@
 
     def get_details(self, dev):
         all_devices = self._plugin.storage_discovery.all_devices()
-        device = all_devices[dev]
-        txt = self._plugin._header.format(bus=device.bus, name=device.name,
-                                          size="%sGB" % device.size)
+
+        if dev in all_devices:
+            device = all_devices[dev]
+            txt = self._plugin._header.format(bus=device.bus, name=device.name,
+                                              size="%sGB" % device.size)
+        else:
+            txt = self._plugin._header.format(bus="", name=dev, size="")
 
         self.text(txt)
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If08541192fef9e263436a0c5768d2f9a95ee9b01
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>



More information about the node-patches mailing list