From 1827421be6596e8be416e179eefeb6f26ad14eba Mon Sep 17 00:00:00 2001 From: themylogin Date: Wed, 14 Feb 2024 12:49:00 +0100 Subject: [PATCH] Properly cleanup old manifest from the cloned `/data` directory --- truenas_install/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/truenas_install/__main__.py b/truenas_install/__main__.py index 77292e2c..4f8280fb 100644 --- a/truenas_install/__main__.py +++ b/truenas_install/__main__.py @@ -464,12 +464,14 @@ def main(): for excluded in data_exclude: remove = f"{root}/{excluded}" try: - shutil.rmtree(remove, True) + shutil.rmtree(remove) except NotADirectoryError: try: os.unlink(remove) except FileNotFoundError: pass + except FileNotFoundError: + pass exclude_list = [] for walk_root, dirs, files in os.walk(root):