From 567ac874403749418341b4f25bb0e4ad57f0423c Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 22 Sep 2016 15:43:41 +0200 Subject: [PATCH] Remove target resolv.conf before proceeding. --- src/modules/networkcfg/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/networkcfg/main.py b/src/modules/networkcfg/main.py index 98bc231c5..57eb68803 100644 --- a/src/modules/networkcfg/main.py +++ b/src/modules/networkcfg/main.py @@ -57,6 +57,10 @@ def run(): source_resolv = "/etc/resolv.conf" target_resolv = os.path.join(root_mount_point, "etc/resolv.conf") if source_resolv != target_resolv and os.path.exists(source_resolv): + try: + os.remove(target_resolv) + except FileNotFoundError: + libcalamares.utils.debug("Couldn't remove {}".format(target_resolv)) try: shutil.copy(source_resolv, target_resolv) except FileNotFoundError: