[node-patches] Change in ovirt-node[master]: setup: add callback to verify rng input

jboggs at redhat.com jboggs at redhat.com
Mon Oct 22 19:25:53 UTC 2012


Joey Boggs has uploaded a new change for review.

Change subject: setup: add callback to verify rng input
......................................................................

setup: add callback to verify rng input

rhbz#868848

Change-Id: Ie3a47eb7233412ef44e49e8ff92f41a7cf0f9900
Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
M scripts/ovirt-config-setup.py
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/33/8733/1

diff --git a/scripts/ovirt-config-setup.py b/scripts/ovirt-config-setup.py
index 1180bf2..17a4183 100755
--- a/scripts/ovirt-config-setup.py
+++ b/scripts/ovirt-config-setup.py
@@ -682,6 +682,18 @@
             self.reset_screen_colors()
             self.gridform.draw()
 
+    def valid_rng_bytes_callback(self):
+        rng_bytes = self.rng_bytes.value()
+        if len(rng_bytes) > 0 and not rng_bytes.isdigit() \
+                or rng_bytes.startswith("0"):
+            self.rng_bytes.set("")
+            self._create_warn_screen()
+            ButtonChoiceWindow(self.screen, "Network", "Invalid RNG Bytes Value",
+                               buttons=['Ok'])
+            self.reset_screen_colors()
+            self.gridform.draw()
+            self._set_title()
+
     def screen_locked_page(self, screen):
         self.screen_locked = True
         elements = Grid(1, 3)
@@ -948,6 +960,7 @@
         rng_elements.setField(self.disable_aes_ni, 0, 0, anchorLeft=1)
         rng_bit_elements.setField(Label("Bytes Used: "), 0, 0, anchorLeft=1)
         self.rng_bytes = Entry(3, scroll=0)
+        self.rng_bytes.setCallback(self.valid_rng_bytes_callback)
         if self.current_rng_bytes > 0:
             self.rng_bytes.set(self.current_rng_bytes)
         rng_bit_elements.setField(self.rng_bytes, 1, 0, anchorLeft=1)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3a47eb7233412ef44e49e8ff92f41a7cf0f9900
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list