diff options
author | jakub <jakub> | 1999-10-18 16:54:16 +0000 |
---|---|---|
committer | jakub <jakub> | 1999-10-18 16:54:16 +0000 |
commit | b7f38f207e901acc8cada73d72701c924d824c33 (patch) | |
tree | 2a4da8fd132ec16cace35d45d1a19fae60879f45 /todo.py | |
parent | d438a3f6ddc6f17a7b2955757a9fe877e836f440 (diff) | |
download | anaconda-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.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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") |