Per the BZ, the setup package will now handle /etc/hosts --- network.py | 49 ------------------------------------------------- packages.py | 2 +- 2 files changed, 1 insertions(+), 50 deletions(-) diff --git a/network.py b/network.py index af6d858..e0d802c 100644 --- a/network.py +++ b/network.py @@ -644,55 +644,6 @@ class Network: f.close() shutil.move(newnetwork, destnetwork) - # /etc/hosts - domainname = None - if (not instPath) or (not os.path.isfile(instPath + "/etc/hosts")): - f = open(instPath + "/etc/hosts", "w") - - log.info("self.hostname = %s", self.hostname) - - # IP address - ip = self.lookupHostname() - if ip in [ "127.0.0.1", "::1" ]: - ip = None - - # fqdn and hostname - if "." in self.hostname: - fqdn = self.hostname - hostname = self.hostname.split('.', 1)[0] - else: - fqdn = socket.getfqdn(self.hostname) - hostname = self.hostname - - if fqdn in [ "localhost.localdomain", "localhost", - "localhost6.localdomain6", "localhost6", hostname ] \ - or "." not in fqdn: - fqdn = None - - # domainname - if fqdn: - domainname = fqdn.split('.', 1)[1] - if domainname in [ "localdomain", "localdomain6" ]: - domainname = None - else: - domainname = None - - localline = "localhost.localdomain localhost" - if not ip and (hostname and hostname != "localhost"): - # add short hostname to 127.0.0.1 - localline += " " + hostname - - f.write("# Do not remove the following line, or various programs\n") - f.write("# that require network functionality will fail.\n") - f.write("127.0.0.1\t\t" + localline + "\n") - f.write("::1\t\tlocalhost6.localdomain6 localhost6\n") - - if ip and fqdn: - # Add an extra entry for ip, fqdn and hostname - f.write("%s\t\t%s %s\n" % (ip, fqdn, 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.domains == ["localdomain"] or not self.domains: diff --git a/packages.py b/packages.py index f871c49..93d6e96 100644 --- a/packages.py +++ b/packages.py @@ -228,7 +228,7 @@ def setFileCons(anaconda): "/etc/modprobe.conf", "/etc/modprobe.conf~", "/var/log/wtmp", "/var/run/utmp", "/etc/crypttab", "/dev/log", "/var/lib/rpm", "/", "/etc/raidtab", - "/etc/mdadm.conf", "/etc/hosts", "/etc/sysconfig/network", + "/etc/mdadm.conf", "/etc/sysconfig/network", "/etc/udev/rules.d/70-persistent-net.rules", "/root/install.log", "/root/install.log.syslog", "/etc/shadow", "/etc/shadow-", "/etc/gshadow"] + \ -- 1.6.1.3 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list