diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-05-31 17:20:39 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-05-31 17:26:20 +0200 |
commit | d732a214bfdbc795a01e0a9159abf623ec94a3be (patch) | |
tree | 530a8dc44fc68e3bbc80dc4eced3fa752b1ecee3 /src/live | |
parent | 914bd993fcb347a24d65e64ba838cb34f72ab14d (diff) |
live: revisit logging for checksum file creationv1.3.2-9
Add logging before calculating checksum to provide a hint to user on what is
going on while ogClient is still busy.
Diffstat (limited to 'src/live')
-rw-r--r-- | src/live/ogOperations.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index 6e528f8..3eee06a 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -160,14 +160,15 @@ class OgLiveOperations: def _write_md5_file(self, path): if not os.path.exists(path): - raise OgError(f'Invalid image path {path} when computing md5 checksum') + raise OgError(f'Failed to calculate checksum, image file {path} does not exist') + filename = path + ".full.sum" dig = self._compute_md5(path) try: with open(filename, 'w') as f: f.write(dig) except: - logging.error(f'cannot write {filename}') + logging.error(f'Cannot write checksum {filename}') return -1 return 0 @@ -470,12 +471,12 @@ class OgLiveOperations: self._ogbrowser_clear_logs() self._restartBrowser(self._url_log) + logging.info(f'Request to create image {name}.img at repository {repo}') + if ogChangeRepo(repo, smb_user=self._smb_user, smb_pass=self._smb_pass) != 0: self._restartBrowser(self._url) raise OgError(f'Cannot change image repository to {repo}') - logging.info(f'Request to create image {name}.img at repository {repo}') - if ogRest.terminated: return @@ -560,6 +561,9 @@ class OgLiveOperations: else: raise + logging.info(f'Writing checksum file {name}.img.full.sum...') + logging.info('*DO NOT REBOOT OR POWEROFF* the client during this time') + if self._write_md5_file(f'/opt/opengnsys/images/{name}.img') == -1: raise OgError(f'Cannot write {name}.full.sum file') |