summaryrefslogtreecommitdiffstats
path: root/network.py
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2009-01-15 10:48:01 -0800
committerDavid Cantrell <dcantrell@redhat.com>2009-01-15 11:18:41 -1000
commit7712a0ac3b165e61bc718b6ffd9737a10f81825a (patch)
tree709ad637960b9d0ccb4054c7b1fe35ecfc0822a8 /network.py
parentd528a07613ba7a767524d200da302c1b831d5c8a (diff)
downloadanaconda-7712a0ac3b165e61bc718b6ffd9737a10f81825a.tar.gz
anaconda-7712a0ac3b165e61bc718b6ffd9737a10f81825a.tar.xz
anaconda-7712a0ac3b165e61bc718b6ffd9737a10f81825a.zip
Only skip (over)writing netconfig if we have an actual instPath
This fixes network bringup in anaconda itself where instPath is still ''. We were finding the pre-written stub config files outside of /mnt/sysimage and skipping any modifications to them. This kept NetworkManager from bringing up the device. Signed-off-by: David Cantrell <dcantrell@redhat.com>
Diffstat (limited to 'network.py')
-rw-r--r--network.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/network.py b/network.py
index b50605e95..0d0e2b035 100644
--- a/network.py
+++ b/network.py
@@ -531,7 +531,7 @@ class Network:
device = dev.get('DEVICE')
cfgfile = "%s/ifcfg-%s" % (netscripts, device,)
- if os.path.isfile(cfgfile):
+ if (instPath) and (os.path.isfile(cfgfile)):
continue
bootproto = dev.get('BOOTPROTO').lower()
@@ -600,7 +600,7 @@ class Network:
# handle the keys* files if we have those
if dev.get("KEY"):
cfgfile = "%s/keys-%s" % (netscripts, device,)
- if os.path.isfile(cfgfile):
+ if not instPath == '' and os.path.isfile(cfgfile):
continue
newkey = "%s/keys-%s.new" % (netscripts, device,)
@@ -622,7 +622,7 @@ class Network:
log.warning("unable to copy %s to target system" % (dhclientconf,))
# /etc/sysconfig/network
- if not os.path.isfile(destnetwork):
+ if (not instPath) and (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 os.path.isfile(instPath + "/etc/hosts"):
+ if (not instPath) and (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 os.path.isfile(instPath + '/etc/resolv.conf'):
+ if (not instPath) and (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)