summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/tiptorrent.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/utils/tiptorrent.py b/src/utils/tiptorrent.py
index 12230c0..d46b1c7 100644
--- a/src/utils/tiptorrent.py
+++ b/src/utils/tiptorrent.py
@@ -62,6 +62,7 @@ def tip_write_csum(image_name):
def tip_check_csum(tip_addr, image_name):
"""
"""
+ logging.info(f'Verifying checksum for {image_name}.img, please wait...')
image_path = f'/opt/opengnsys/cache/opt/opengnsys/images/{image_name}.img'
if not os.path.exists(image_path):
logging.error('Invalid image path')
@@ -78,6 +79,7 @@ def tip_client_get(tip_addr, image_name):
"""
"""
logging.info(f'Fetching image {image_name} from tiptorrent server at {tip_addr}')
+ logging.info('*DO NOT REBOOT OR POWEROFF* the client during this time')
cmd = f'tiptorrent-client {tip_addr} {image_name}.img'
logfile = open('/tmp/command.log', 'wb', 0)
@@ -87,7 +89,7 @@ def tip_client_get(tip_addr, image_name):
cwd='/opt/opengnsys/cache/opt/opengnsys/images/')
proc.communicate()
except:
- logging.error('Exception when running tiptorrent client GET subprocess')
+ logging.exception('Exception when running tiptorrent client GET subprocess')
raise ValueError('Unexpected error running tiptorrent subprocess')
finally:
logfile.close()
@@ -96,5 +98,6 @@ def tip_client_get(tip_addr, image_name):
logging.error(f'Error fetching image {image_name} via tiptorrent')
raise ValueError('Tiptorrent download failed')
else:
- logging.info('tiptorrent transfer completed, writing checksum')
+ logging.info('Calculating checksum...')
+ logging.info('*DO NOT REBOOT OR POWEROFF* the client during this time')
tip_write_csum(image_name)