summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-04-22 14:53:06 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-04-22 14:56:09 +0200
commit7d26f0f69b01016f1a8c563ac734253e2f9c6d5b (patch)
treed8fa6c53deafe8a5352ab3e4b0d702d6d5466213
parent8661a99a369f05fa32c2d791e38b0539bb39e398 (diff)
utils: add logging for checksum validation
Display if checksum validation is correct or not.
-rw-r--r--src/utils/tiptorrent.py12
1 files changed, 9 insertions, 3 deletions
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):