diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/live/ogOperations.py | 2 | ||||
-rw-r--r-- | src/utils/tiptorrent.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index d0129e8..7d0d832 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -219,7 +219,7 @@ class OgLiveOperations: if (not os.path.exists(image_path)): raise OgError(f'could not find {image_path} in cache') if (not tip_check_csum(repo, name)): - raise OgError(f'checksum file {name}.img.full.sum is missing in repository {repo}') + raise OgError(f'Failed to validate checksum for {name}.img') self._restore_image(image_path, devpath) diff --git a/src/utils/tiptorrent.py b/src/utils/tiptorrent.py index d3e95f4..8fc1631 100644 --- a/src/utils/tiptorrent.py +++ b/src/utils/tiptorrent.py @@ -67,11 +67,14 @@ def tip_check_csum(tip_addr, image_name): logging.info(f'Verifying checksum for {image_name}.img, please wait...') image_path = f'{OG_CACHE_IMAGE_PATH}{image_name}.img' if not os.path.exists(image_path): - raise OgError(f'Invalid image path {image_path} for tiptorrent image csum comparison') + raise OgError(f'File {image_path} does not exist') cache_csum = _compute_md5(image_path) remote_csum = tip_fetch_csum(tip_addr, image_name) + if not os.path.exists(f"{image_path}.full.sum"): + raise OgError(f'File {image_path}.full.sum does not exist in repository {tip_addr}') + if cache_csum == remote_csum: ret = True logging.info(f'Checksum is OK for {image_name}.img') |