diff options
Diffstat (limited to 'src/live')
-rw-r--r-- | src/live/ogOperations.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index 0a75630..ea9f5cb 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -122,8 +122,14 @@ class OgLiveOperations: raise ValueError('Invalid image path when computing md5 checksum') filename = path + ".full.sum" dig = self._compute_md5(path) - with open(filename, 'w') as f: - f.write(dig) + try: + with open(filename, 'w') as f: + f.write(dig) + except: + logging.error(f'cannot write {filename}') + return -1 + + return 0 def _copy_image_to_cache(self, image_name): """ @@ -515,7 +521,9 @@ class OgLiveOperations: image_info.perms = perms image_info.mtime = mtime - self._write_md5_file(f'/opt/opengnsys/images/{name}.img') + if self._write_md5_file(f'/opt/opengnsys/images/{name}.img') == -1: + logging.error(f'cannot write {name}.full.sum file') + raise ValueError(f'Error: Cannot write {name}.full.sum file') self._restartBrowser(self._url) |