summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/live/ogOperations.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py
index b22d8b2..98528a7 100644
--- a/src/live/ogOperations.py
+++ b/src/live/ogOperations.py
@@ -208,6 +208,13 @@ class OgLiveOperations:
r = shutil.copy(src, dst)
tip_write_csum(image_name)
except (OSError, OgError) as e:
+ try:
+ if os.path.exists(dst):
+ os.unlink(dst)
+ if os.path.exists(f"{dst}.full.sum"):
+ os.unlink(f"{dst}.full.sum")
+ except OSError as e:
+ pass
raise OgError(f'Error copying image {image_name} to cache. Reported: {e}') from e
if (not os.path.exists(dst)):