Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 317806 Details for
Bug 464191
anaconda, hostname and /etc/hosts
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
One way to fix this.
anaconda-11.4.1.38-fqdn.patch (text/plain), 3.15 KB, created by
Thomas Woerner
on 2008-09-26 16:08:43 UTC
(
hide
)
Description:
One way to fix this.
Filename:
MIME Type:
Creator:
Thomas Woerner
Created:
2008-09-26 16:08:43 UTC
Size:
3.15 KB
patch
obsolete
>diff -up anaconda-11.4.1.38/network.py.fqdn anaconda-11.4.1.38/network.py >--- anaconda-11.4.1.38/network.py.fqdn 2008-09-23 16:44:43.000000000 +0200 >+++ anaconda-11.4.1.38/network.py 2008-09-23 18:54:38.000000000 +0200 >@@ -551,43 +551,56 @@ class Network: > > # /etc/hosts > f = open(instPath + "/etc/hosts", "w") >- localline = "" > > log.info("self.hostname = %s", self.hostname) > >+ # IP address > ip = self.lookupHostname() >- l = string.split(self.hostname, ".") >+ if ip in [ "127.0.0.1", "::1" ]: >+ ip = None > >- # If the hostname is not resolvable, tie it to 127.0.0.1 >- if not ip and self.hostname != "localhost.localdomain": >- localline += self.hostname + " " >- if len(l) > 1: >- localline += l[0] + " " >- >- # always add the short hostname to 127.0.0.1 (#253979) >- localline += "localhost.localdomain localhost" >- if len(l) > 1: >- localline += " " + l[0] >+ # fqdn and hostname >+ if "." in hostname: >+ fqdn = self.hostname >+ hostname = hostname.split('.', 1)[0] >+ else: >+ fqdn = socket.getfqdn(self.hostname) >+ hostname = self.hostname >+ if fqdn in [ "localhost.localdomain", "localhost", >+ "localhost6.localdomain6", "localhost6" ]: >+ fqdn = None >+ >+ # domainname >+ domainname = fqdn[(fqdn.find('.') + 1):] >+ if domainname in [ "localdomain", "localdomain6" ]: >+ domainname = None >+ >+ localline = "localhost.localdomain localhost" >+ if not ip or not fqdn: >+ # There is no ip or no fqdn, tie it to 127.0.0.1. >+ if fqdn: >+ # add fqdn to 127.0.0.1 >+ localline += " " + fqdn >+ if 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: >- nameline = "%s\t\t%s" % (ip, self.hostname) >- n = string.split(self.hostname, ".") >- if len(n) > 1: >- nameline = nameline + " " + n[0] >- f.write("%s\n" %(nameline,)) >+ 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: >- if '.' in self.hostname: >- # chop off everything before the leading '.' >- domain = self.hostname[(string.find(self.hostname, '.') + 1):] >- self.domains = [domain] >+ if domainname: >+ self.domains = [domainname] > > # /etc/resolv.conf > f = open(instPath + "/etc/resolv.conf", "w")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 464191
:
317806
|
318055