From 3a511565076cc7a190d3343f7d83b4aece0c7137 Mon Sep 17 00:00:00 2001 From: hasan7n Date: Tue, 19 Dec 2023 05:20:32 +0100 Subject: [PATCH] fix problem of broken links after moving storage --- cli/medperf/comms/entity_resources/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/medperf/comms/entity_resources/resources.py b/cli/medperf/comms/entity_resources/resources.py index 0da6e0615..c826ace6b 100644 --- a/cli/medperf/comms/entity_resources/resources.py +++ b/cli/medperf/comms/entity_resources/resources.py @@ -78,7 +78,7 @@ def get_cube_image(url: str, cube_path: str, hash_value: str = None) -> str: image_cube_path = os.path.join(cube_path, image_path) os.makedirs(image_cube_path, exist_ok=True) image_cube_file = os.path.join(image_cube_path, image_name) - if os.path.exists(image_cube_file): + if os.path.islink(image_cube_file): # could be a broken link # Remove existing links os.unlink(image_cube_file)