Don't try to overwrite resolv.conf in no-chroot mode.
This commit is contained in:
parent
5e12096e4b
commit
2e27c3b84b
@ -56,7 +56,7 @@ def run():
|
|||||||
# We need to overwrite the default resolv.conf in the chroot.
|
# We need to overwrite the default resolv.conf in the chroot.
|
||||||
source_resolv = "/etc/resolv.conf"
|
source_resolv = "/etc/resolv.conf"
|
||||||
target_resolv = os.path.join(root_mount_point, "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:
|
try:
|
||||||
shutil.copy(source_resolv, target_resolv)
|
shutil.copy(source_resolv, target_resolv)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
Loading…
Reference in New Issue
Block a user