From 59ab9204ce78c42de5551ca2d41c0621afed6974 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Sun, 21 Jul 2024 21:56:09 +0200 Subject: utils: consolidate logging to write checksum file to cache Move log message to function that is called both by unicast and tiptorrent. --- src/utils/tiptorrent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/tiptorrent.py b/src/utils/tiptorrent.py index 079a41f..f93b855 100644 --- a/src/utils/tiptorrent.py +++ b/src/utils/tiptorrent.py @@ -50,6 +50,9 @@ def tip_write_csum(image_name): if not os.path.exists(image_path): raise OgError(f'Invalid image path {image_path} for tiptorrent checksum writing') + logging.info('Calculating checksum...') + logging.info('*DO NOT REBOOT OR POWEROFF* the client during this time') + filename = image_path + ".full.sum" csum = _compute_md5(image_path) try: @@ -106,6 +109,4 @@ def tip_client_get(tip_addr, image_name): if proc.returncode != 0: raise OgError(f'Error fetching image {image_name} via tiptorrent') else: - logging.info('Calculating checksum...') - logging.info('*DO NOT REBOOT OR POWEROFF* the client during this time') tip_write_csum(image_name) -- cgit v1.2.3-18-g5258