diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-07-29 23:30:24 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-07-30 00:51:37 +0200 |
commit | 8395982244bf032676624af97e5ddb9bb6636bd8 (patch) | |
tree | 3598f005da0d85a63afd5fab60db4bc20d857b6f /src/live/ogOperations.py | |
parent | 210a70fc73ff5a1ef21da914eee320d969a95b06 (diff) |
live: validate file existence and checksum for unicast cache
after copying file to cache, validate that file exists in cache and checksum
correct.
Diffstat (limited to 'src/live/ogOperations.py')
-rw-r--r-- | src/live/ogOperations.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index d4817f6..086a0b4 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -208,6 +208,11 @@ class OgLiveOperations: if (not os.path.exists(image_path) or not tip_check_csum(repo, name)): self._copy_image_to_cache(name) + + if (not os.path.exists(image_path)): + raise OgError(f'could not find {image_path} in cache') + if (not tip_check_csum(repo, name)): + raise OgError(f'Failed to validate checksum for {name}.img') else: if os.access(f'/opt/opengnsys/images', os.R_OK) == False: raise OgError('Cannot access /opt/opengnsys/images in read mode, check permissions') |