diff options
author | David Cantrell <dcantrell@redhat.com> | 2009-10-30 11:25:43 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2009-11-02 14:35:30 -1000 |
commit | e1bf121c48a3cbf9770b32de45b33a52a92fb3bb (patch) | |
tree | 31d97051dafc7cb4488bc057286e4aafa22b42ee /network.py | |
parent | 53e90adccefb2c117cfc6addb154a698dfff5110 (diff) | |
download | anaconda-e1bf121c48a3cbf9770b32de45b33a52a92fb3bb.tar.gz anaconda-e1bf121c48a3cbf9770b32de45b33a52a92fb3bb.tar.xz anaconda-e1bf121c48a3cbf9770b32de45b33a52a92fb3bb.zip |
Do not modify /etc/hosts from setup package (#530343).
Adding the user-specified hostname to the 127.0.0.1 line is breaking
virt systems, among other things. I'm not entirely sure we need this
functionality anymore (faking the hostname as 127.0.0.1).
This reverts the changes done in
1aa67d5a2cdacd45f92ba15aa9392ba7191a49c7, but looking at the comments
for #506384, you'll see the same complaints as #530343 has are present.
Diffstat (limited to 'network.py')
-rw-r--r-- | network.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/network.py b/network.py index 033725004..24538e3f3 100644 --- a/network.py +++ b/network.py @@ -679,29 +679,6 @@ class Network: if domainname: self.domains = [domainname] - # /etc/hosts - # update lines for 127.0.0.1 and ::1 with hostname if the file exists - if instPath and os.path.isfile(instPath + "/etc/hosts"): - of = open(instPath + "/etc/hosts", "r") - updatedlines = [] - update = False - for line in of: - line = line.strip() - if line.startswith('127.0.0.1') or line.startswith('::1'): - if self.hostname not in line.split(): - line += " %s" % self.hostname - update = True - updatedlines.append(line) - of.close() - - if update: - nf = open(instPath + "/etc/hosts", "w") - upd_comment = "# hostname %s added to /etc/hosts by anaconda\n" % self.hostname - nf.write(upd_comment + '\n'.join(updatedlines) + '\n') - nf.close() - log.info("/etc/hosts updated with hostname %s" % self.hostname) - - # /etc/resolv.conf if (not instPath) or (not os.path.isfile(instPath + '/etc/resolv.conf')) or flags.livecdInstall: if os.path.isfile('/etc/resolv.conf') and instPath != '': |