diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/tiptorrent.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/tiptorrent.py b/src/utils/tiptorrent.py index 9715b21..d3e95f4 100644 --- a/src/utils/tiptorrent.py +++ b/src/utils/tiptorrent.py @@ -14,7 +14,7 @@ import shutil import subprocess import urllib.request from src.log import OgError -from src.utils.cache import mount_cache +from src.utils.cache import * def _compute_md5(path, bs=2**20): m = hashlib.md5() @@ -45,7 +45,7 @@ def tip_write_csum(image_name): if not mount_cache(): raise OgError(f'Failed to checksum {image_name}: cache partition is not available') - image_path = f'/opt/opengnsys/cache/opt/opengnsys/images/{image_name}.img' + image_path = f'{OG_CACHE_IMAGE_PATH}{image_name}.img' if not os.path.exists(image_path): raise OgError(f'Invalid image path {image_path} for tiptorrent checksum writing') @@ -65,7 +65,7 @@ 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' + image_path = f'{OG_CACHE_IMAGE_PATH}{image_name}.img' if not os.path.exists(image_path): raise OgError(f'Invalid image path {image_path} for tiptorrent image csum comparison') @@ -93,7 +93,7 @@ def tip_client_get(tip_addr, image_name): try: proc = subprocess.Popen(shlex.split(cmd), stdout=logfile, - cwd='/opt/opengnsys/cache/opt/opengnsys/images/') + cwd=OG_CACHE_IMAGE_PATH) proc.communicate() except OSError as e: raise OgError('Unexpected error running tiptorrent subprocess: {e}') from e |