summaryrefslogtreecommitdiffstats
path: root/src/utils/tiptorrent.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/tiptorrent.py')
-rw-r--r--src/utils/tiptorrent.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/utils/tiptorrent.py b/src/utils/tiptorrent.py
index 9ed6a65..9715b21 100644
--- a/src/utils/tiptorrent.py
+++ b/src/utils/tiptorrent.py
@@ -14,6 +14,7 @@ import shutil
import subprocess
import urllib.request
from src.log import OgError
+from src.utils.cache import mount_cache
def _compute_md5(path, bs=2**20):
m = hashlib.md5()
@@ -41,9 +42,9 @@ def tip_fetch_csum(tip_addr, image_name):
def tip_write_csum(image_name):
- """
- TODO: Check for CACHE partition
- """
+ if not mount_cache():
+ raise OgError(f'Failed to checksum {image_name}: cache partition is not available')
+
image_path = f'/opt/opengnsys/cache/opt/opengnsys/images/{image_name}.img'
if not os.path.exists(image_path):