live: fix omited error report in tip_client_get

tip_client_get raises the proper error exceptions but the except
block in _restore_image_tiptorrent overwrites the reported error.
Move the raise statements in _restore_image_tiptorrent outside
of the except block.
master
Alejandro Sirgo Rica 2024-05-06 14:23:29 +02:00
parent 5ea6f73343
commit 8171ddd15f
1 changed files with 6 additions and 7 deletions

View File

@ -167,17 +167,16 @@ class OgLiveOperations:
image_path = f'/opt/opengnsys/cache/opt/opengnsys/images/{name}.img'
try:
if (not os.path.exists(image_path) or
not tip_check_csum(repo, name)):
if (not os.path.exists(image_path) or not tip_check_csum(repo, name)):
tip_client_get(repo, name)
except:
self._restartBrowser(self._url)
if (not os.path.exists(image_path)):
raise OgError(f'Image file {image_path} does not exist')
if (not tip_check_csum(repo, name)):
raise OgError(f'checksum file {name}.full.sum is missing in repository {repo}')
raise
raise OgError(f'Unexpected error when restoring image file {image_path}')
if (not os.path.exists(image_path)):
raise OgError(f'Image file {image_path} does not exist')
if (not tip_check_csum(repo, name)):
raise OgError(f'checksum file {name}.full.sum is missing in repository {repo}')
self._restore_image(image_path, devpath)