summaryrefslogtreecommitdiffstats
path: root/todo.py
diff options
context:
space:
mode:
authorjakub <jakub>1999-10-18 16:54:16 +0000
committerjakub <jakub>1999-10-18 16:54:16 +0000
commitb7f38f207e901acc8cada73d72701c924d824c33 (patch)
tree2a4da8fd132ec16cace35d45d1a19fae60879f45 /todo.py
parentd438a3f6ddc6f17a7b2955757a9fe877e836f440 (diff)
downloadanaconda-b7f38f207e901acc8cada73d72701c924d824c33.tar.gz
anaconda-b7f38f207e901acc8cada73d72701c924d824c33.tar.xz
anaconda-b7f38f207e901acc8cada73d72701c924d824c33.zip
If the hostname was not looked up from DNS and domain is still
"localdomain" at time it should be written into resolv.conf, try to guess it from hostname. Without this, for pure CD-ROM install one gets search localdomain in resolv.conf which is not a good idea.
Diffstat (limited to 'todo.py')
-rw-r--r--todo.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/todo.py b/todo.py
index 456a7721a..66717b795 100644
--- a/todo.py
+++ b/todo.py
@@ -925,6 +925,15 @@ class ToDo:
f.write ("%s\t\t%s\n" % (ip, dev.hostname))
f.close ()
+ # If the hostname was not looked up, but typed in by the user,
+ # domain might not be computed, so do it now.
+ if self.network.domains == [ "localdomain" ] or not self.network.domains:
+ if self.network.hostname != "localhost.localdomain":
+ if '.' in self.network.hostname:
+ # chop off everything before the leading '.'
+ domain = self.network.hostname[(string.find(self.network.hostname, '.') + 1):]
+ self.network.domains = [ domain ]
+
# /etc/resolv.conf
f = open (self.instPath + "/etc/resolv.conf", "w")
f.write ("search " + string.joinfields (self.network.domains, ' ') + "\n")