summaryrefslogtreecommitdiffstats
path: root/iw/network_gui.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-05-13 21:09:25 +0000
committerMike Fulbright <msf@redhat.com>2002-05-13 21:09:25 +0000
commit568d10a6e1842e86643a75933304ef920971760d (patch)
treeab012a8a43df9dd3bec902700f0530e096312bf8 /iw/network_gui.py
parentf9c14ba29c0eadc8b9dc94a69c8944a0496950e9 (diff)
downloadanaconda-568d10a6e1842e86643a75933304ef920971760d.tar.gz
anaconda-568d10a6e1842e86643a75933304ef920971760d.tar.xz
anaconda-568d10a6e1842e86643a75933304ef920971760d.zip
handle bad hostnames per bug #64819
Diffstat (limited to 'iw/network_gui.py')
-rw-r--r--iw/network_gui.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/iw/network_gui.py b/iw/network_gui.py
index dd68ce630..bb13a15aa 100644
--- a/iw/network_gui.py
+++ b/iw/network_gui.py
@@ -19,6 +19,7 @@ from iw_gui import *
from isys import *
import gui
from translate import _, N_
+import network
import checklist
import ipwidget
@@ -41,7 +42,11 @@ class NetworkWindow(InstallWindow):
tmpvals = {}
for t in range(len(global_options)):
if t == 0:
- tmpvals[t] = self.hostname.get_text()
+ tmpvals[t] = string.strip(self.hostname.get_text())
+ neterrors = network.sanityCheckHostname(tmpvals[t])
+ if neterrors is not None:
+ self.handleBadHostname(tmpvals[t], neterrors)
+ raise gui.StayOnScreen
else:
try:
tmpvals[t] = self.globals[global_options[t]].dehydrate()
@@ -104,6 +109,10 @@ class NetworkWindow(InstallWindow):
onboot = "no"
dev.set(("ONBOOT", onboot))
+ def handleBadHostname(self, hostname, error):
+ self.intf.messageWindow(_("Error With Data"),
+ _("The hostname \"%s\" is not valid for the following reason:\n\n%s") % (hostname, error))
+
def handleIPError(self, field, errmsg):
self.intf.messageWindow(_("Error With Data"),
_("An error occurred converting "