From d732a214bfdbc795a01e0a9159abf623ec94a3be Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Fri, 31 May 2024 17:20:39 +0200 Subject: live: revisit logging for checksum file creation Add logging before calculating checksum to provide a hint to user on what is going on while ogClient is still busy. --- src/live/ogOperations.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/live') 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') -- cgit v1.2.3-18-g5258