summaryrefslogtreecommitdiffstats
path: root/network.py
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2009-01-20 13:44:46 -0800
committerDavid Cantrell <dcantrell@redhat.com>2009-01-21 14:28:40 -1000
commitb06d28c57b97f00ecd01cf4a9a82104188bc0935 (patch)
tree188a32076bac9d2ee7380fe456950e5f5db15308 /network.py
parentc177b4911591a3925a53eb78035a2c6253440307 (diff)
downloadanaconda-b06d28c57b97f00ecd01cf4a9a82104188bc0935.tar.gz
anaconda-b06d28c57b97f00ecd01cf4a9a82104188bc0935.tar.xz
anaconda-b06d28c57b97f00ecd01cf4a9a82104188bc0935.zip
Fix a logic problem with network file write outs. (480769)
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. Signed-off-by: David Cantrell <dcantrell@redhat.com>
Diffstat (limited to 'network.py')
-rw-r--r--network.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/network.py b/network.py
index 0d0e2b035..af6d858f7 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,))