From 8171ddd15fb31672188bbe1a1953e9eb176291a7 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 6 May 2024 14:23:29 +0200 Subject: 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. --- src/live/ogOperations.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index 68aebac..00079eb 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -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) -- cgit v1.2.3-18-g5258