Don't try to overwrite resolv.conf in no-chroot mode.

This commit is contained in:
Teo Mrnjavac 2016-08-02 13:25:00 +02:00
parent 5e12096e4b
commit 2e27c3b84b

View File

@ -56,7 +56,7 @@ def run():
# We need to overwrite the default resolv.conf in the chroot.
source_resolv = "/etc/resolv.conf"
target_resolv = os.path.join(root_mount_point, "etc/resolv.conf")
if os.path.exists(source_resolv):
if source_resolv != target_resolv and os.path.exists(source_resolv):
try:
shutil.copy(source_resolv, target_resolv)
except FileNotFoundError: