[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [PATCH] Fix a logic problem with network file write outs. (480769)
- From: David Cantrell <dcantrell redhat com>
- To: Discussion of Development and Customization of the Red Hat Linux Installer <anaconda-devel-list redhat com>
- Subject: Re: [PATCH] Fix a logic problem with network file write outs. (480769)
- Date: Wed, 21 Jan 2009 14:27:27 -1000
Jesse Keating wrote:
> We're trying to cover two scenarios with a single if statement:
> The scenario pre-install where we're writing out files to the
> tmpfs in order to bring up the network.
>
> The scenario post-install where we're writing out files to the
> installed system for network on reboot.
>
> We're also trying to preserve any files that may be in the installed
> filesystem post-install time. The logic should now handle this.
> ---
> network.py | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/network.py b/network.py
> index 0d0e2b0..af6d858 100644
> --- a/network.py
> +++ b/network.py
> @@ -622,7 +622,7 @@ class Network:
> log.warning("unable to copy %s to target system" % (dhclientconf,))
>
> # /etc/sysconfig/network
> - if (not instPath) and (not os.path.isfile(destnetwork)):
> + if (not instPath) or (not os.path.isfile(destnetwork)):
> newnetwork = "%s.new" % (destnetwork,)
>
> f = open(newnetwork, "w")
> @@ -646,7 +646,7 @@ class Network:
>
> # /etc/hosts
> domainname = None
> - if (not instPath) and (not os.path.isfile(instPath + "/etc/hosts")):
> + if (not instPath) or (not os.path.isfile(instPath + "/etc/hosts")):
> f = open(instPath + "/etc/hosts", "w")
>
> log.info("self.hostname = %s", self.hostname)
> @@ -700,7 +700,7 @@ class Network:
> self.domains = [domainname]
>
> # /etc/resolv.conf
> - if (not instPath) and (not os.path.isfile(instPath + '/etc/resolv.conf')):
> + if (not instPath) or (not os.path.isfile(instPath + '/etc/resolv.conf')):
> if os.path.isfile('/etc/resolv.conf') and instPath != '':
> destresolv = "%s/etc/resolv.conf" % (instPath,)
> shutil.copy('/etc/resolv.conf', destresolv)
> @@ -721,7 +721,7 @@ class Network:
>
> # /etc/udev/rules.d/70-persistent-net.rules
> rules = instPath + "/etc/udev/rules.d/70-persistent-net.rules"
> - if (not instPath) and (not os.path.isfile(rules)):
> + if (not instPath) or (not os.path.isfile(rules)):
> if not os.path.isdir("%s/etc/udev/rules.d" %(instPath,)):
> iutil.mkdirChain("%s/etc/udev/rules.d" %(instPath,))
>
Looks ok to me. Going to apply it.
--
David Cantrell <dcantrell redhat com>
Red Hat / Honolulu, HI
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]