From 7d26f0f69b01016f1a8c563ac734253e2f9c6d5b Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Mon, 22 Apr 2024 14:53:06 +0200 Subject: utils: add logging for checksum validation Display if checksum validation is correct or not. --- src/utils/tiptorrent.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/utils') diff --git a/src/utils/tiptorrent.py b/src/utils/tiptorrent.py index 83ca052..1d628c1 100644 --- a/src/utils/tiptorrent.py +++ b/src/utils/tiptorrent.py @@ -67,9 +67,15 @@ def tip_check_csum(tip_addr, image_name): cache_csum = _compute_md5(image_path) remote_csum = tip_fetch_csum(tip_addr, image_name) - logging.debug(f'cache_csum: {cache_csum}') - logging.debug(f'remote_csum: {remote_csum}') - return cache_csum == remote_csum + + if cache_csum == remote_csum: + ret = True + logging.info(f'Checksum is OK for {image_name}.img') + else: + ret = False + logging.warn(f'Checksum mismatch for {image_name}.img') + + return ret def tip_client_get(tip_addr, image_name): -- cgit v1.2.3-18-g5258