summaryrefslogtreecommitdiffstats
path: root/src/utils/tiptorrent.py
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-07-21 21:56:09 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-07-21 21:56:09 +0200
commit59ab9204ce78c42de5551ca2d41c0621afed6974 (patch)
tree20c15202ee159d4348cf9d766035370d32fd8d0f /src/utils/tiptorrent.py
parent8ac8dc306e5711832d2ffaa6a783ac12e04e57a6 (diff)
utils: consolidate logging to write checksum file to cache
Move log message to function that is called both by unicast and tiptorrent.
Diffstat (limited to 'src/utils/tiptorrent.py')
-rw-r--r--src/utils/tiptorrent.py5
1 files 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)