[node-patches] Change in ovirt-node[master]: confirmation_page: Do not compare strings and numbers

dougsland at redhat.com dougsland at redhat.com
Thu Jul 2 17:36:36 UTC 2015


Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: confirmation_page: Do not compare strings and numbers
......................................................................

confirmation_page: Do not compare strings and numbers

In commit ab550a39 we added the validation for a warning
message but we do not guarantee that we only compare
number vs numbers. This patch avoid such exception:
ValueError: invalid literal for int() with base 10

Change-Id: I700a4aed2f7c11cb5081377d65bc622e0a5e1f32
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M src/ovirt/node/installer/core/confirmation_page.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/74/43174/1

diff --git a/src/ovirt/node/installer/core/confirmation_page.py b/src/ovirt/node/installer/core/confirmation_page.py
index b4818d9..75833c3 100644
--- a/src/ovirt/node/installer/core/confirmation_page.py
+++ b/src/ovirt/node/installer/core/confirmation_page.py
@@ -92,7 +92,8 @@
             row = ui.Row("row[%s]" % xs, chi)
             ws.append(row)
 
-        if int(self._model["storage.data_size"]) < (50*1024):
+        dsize = int(re.sub('[^0-9]', '', self._model["storage.data_size"]))
+        if dsize < (50*1024):
             ws.extend([ui.Divider("divider.he"),
                       ui.Notice("notice.he", "The size of the data volume is "
                                 "not large enough to use the Engine "


-- 
To view, visit https://gerrit.ovirt.org/43174
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I700a4aed2f7c11cb5081377d65bc622e0a5e1f32
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