From: Colin Walters <walters(a)verbum.org>
systemd changed to generate a symlink resolv.conf ->
/run/networkd/resolv.conf which doesn't exist at installation time.
(What we should do at some point is tell NetworkManager to
serialize its state into the installation root and get out
of the business of writing these files directly)
https://bugzilla.redhat.com/show_bug.cgi?id=1116651
---
pyanaconda/network.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index f1b3ab8..dee420f 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -28,6 +28,7 @@
from pyanaconda import iutil
import socket
import os
+import errno
import time
import threading
import re
@@ -913,10 +914,15 @@ def copyFileToPath(fileName, destPath='', overwrite=False):
if not os.path.isfile(fileName):
return False
destfile = os.path.join(destPath, fileName.lstrip('/'))
- if (os.path.isfile(destfile) and not overwrite):
+ if overwrite:
+ try:
+ os.unlink(destfile)
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ elif os.path.exists(destfile):
return False
- if not os.path.isdir(os.path.dirname(destfile)):
- iutil.mkdirChain(os.path.dirname(destfile))
+ iutil.mkdirChain(os.path.dirname(destfile))
shutil.copy(fileName, destfile)
return True
@@ -1086,7 +1092,7 @@ def write_network_config(storage, ksdata, instClass, rootpath):
disableIPV6(rootpath)
copyIfcfgFiles(rootpath)
copyDhclientConfFiles(rootpath)
- copyFileToPath("/etc/resolv.conf", rootpath,
overwrite=flags.livecdInstall)
+ copyFileToPath("/etc/resolv.conf", rootpath, overwrite=True)
instClass.setNetworkOnbootDefault(ksdata)
# NM_CONTROLLED is not mirrored in ksdata
disableNMForStorageDevices(rootpath, storage)
--
To view this commit on github, visit
https://github.com/rhinstaller/anaconda/commit/8609b8dd1862ee0db5c25ce670...