Loading installsystems/tools.py +2 −4 Original line number Diff line number Diff line Loading @@ -375,12 +375,10 @@ def prepare_chroot(path, mount=True): warn("Mount failed: %s.\n" % e) # trick resolv.conf try: if os.path.exists("/etc/resolv.conf"): if os.path.exists("/etc/resolv.conf") and os.path.exists(os.path.join(path, "etc")): resolv_path = os.path.join(path, "etc/resolv.conf") if os.path.exists(resolv_path): os.rename(resolv_path, "%s.isbackup" % resolv_path) if not os.path.exists(os.path.dirname(resolv_path)): os.makedirs(os.path.dirname(resolv_path)) shutil.copy("/etc/resolv.conf", resolv_path) except Exception as e: warn("resolv.conf tricks fail: %s" % e) Loading @@ -404,7 +402,7 @@ def unprepare_chroot(path, mount=True): Rollback preparation of a chroot environment inside a directory ''' # untrick resolv.conf if os.path.exists("/etc/resolv.conf"): if os.path.exists("/etc/resolv.conf") and os.path.exists(os.path.join(path, "etc")):: resolv_path = os.path.join(path, "etc/resolv.conf") if os.path.exists(resolv_path): os.unlink(resolv_path) Loading Loading
installsystems/tools.py +2 −4 Original line number Diff line number Diff line Loading @@ -375,12 +375,10 @@ def prepare_chroot(path, mount=True): warn("Mount failed: %s.\n" % e) # trick resolv.conf try: if os.path.exists("/etc/resolv.conf"): if os.path.exists("/etc/resolv.conf") and os.path.exists(os.path.join(path, "etc")): resolv_path = os.path.join(path, "etc/resolv.conf") if os.path.exists(resolv_path): os.rename(resolv_path, "%s.isbackup" % resolv_path) if not os.path.exists(os.path.dirname(resolv_path)): os.makedirs(os.path.dirname(resolv_path)) shutil.copy("/etc/resolv.conf", resolv_path) except Exception as e: warn("resolv.conf tricks fail: %s" % e) Loading @@ -404,7 +402,7 @@ def unprepare_chroot(path, mount=True): Rollback preparation of a chroot environment inside a directory ''' # untrick resolv.conf if os.path.exists("/etc/resolv.conf"): if os.path.exists("/etc/resolv.conf") and os.path.exists(os.path.join(path, "etc")):: resolv_path = os.path.join(path, "etc/resolv.conf") if os.path.exists(resolv_path): os.unlink(resolv_path) Loading