Re: [PATCH] Preserve existing network configuration files during install.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jesse Keating wrote:
> On Fri, 2008-12-05 at 09:59 -1000, David Cantrell wrote:
>> -        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 or not fqdn:
>> -            # There is no ip or no fqdn, tie it to 127.0.0.1.
>> +        if 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
> 
> This seems to move the initial setting of 'domainname' into an if
> section, so if we fail the if, domainname is undefined later when we
> check it, line 698 or so.  This is causing a traceback in my current
> setup, where domain is 'localdomain'.  I'm not sure what the right way
> to fix this is, so I'm not submitting a patch (:

Yeah, that's me.  I neglected to initialize domainname to None before
all of that code runs, so that's all we really need.

Commented in 477831 with this info, new build coming.

-- 
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux