diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-05-06 14:23:29 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-05-06 14:23:29 +0200 |
commit | 8171ddd15fb31672188bbe1a1953e9eb176291a7 (patch) | |
tree | fc9fdc464f6d5d231086d500cee2971d916261fe /src | |
parent | 5ea6f7334323fdeb8c3d8a0fa22caeeb3692df5a (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/live/ogOperations.py | 13 |
1 files changed, 6 insertions, 7 deletions
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) |