[node-patches] Change in ovirt-node[master]: hostname must be 64 chars or less

jboggs at redhat.com jboggs at redhat.com
Mon Nov 5 03:06:58 UTC 2012


Joey Boggs has uploaded a new change for review.

Change subject: hostname must be 64 chars or less
......................................................................

hostname must be 64 chars or less

rhbz#871651

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/16/9016/1

diff --git a/scripts/ovirt-config-setup.py b/scripts/ovirt-config-setup.py
index 2f0ded4..f3117c2 100755
--- a/scripts/ovirt-config-setup.py
+++ b/scripts/ovirt-config-setup.py
@@ -624,14 +624,20 @@
             self.gridform.draw()
 
     def valid_hostname_callback(self):
-        if not self.net_hostname.value() == "":
+        if not self.net_hostname.value() == "" or \
+            len(self.net_hostname.value()) > 64:
+            self._create_warn_screen()
+            if len(self.net_hostname.value()) > 64:
+                ButtonChoiceWindow(self.screen, "Configuration Check",
+                                   "Hostname Too Long", buttons=['Ok'])
+                self.net_hostname.set(self.net_hostname.value()[:64])
             if not is_valid_hostname(self.net_hostname.value()):
-                self._create_warn_screen()
                 ButtonChoiceWindow(self.screen, "Configuration Check",
                                    "Invalid Hostname", buttons=['Ok'])
-                self.reset_screen_colors()
-                self.net_hostname.set("localhost")
-                self.gridform.draw()
+                self.net_hostname.set("localhost.localdomain")
+            self.reset_screen_colors()
+            self.gridform.draw()
+            self._set_title()
 
     def valid_iqn_callback(self):
         if not self.iscsi_initiator_config.value() == "":


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

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