diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2022-12-01 15:22:58 +0100 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2022-12-01 15:22:58 +0100 |
commit | 70f1d0d71de033183fb2aed5533ec6937780a5a0 (patch) | |
tree | a8a41100573a1069c827e491bb0b8b059ab96767 | |
parent | 699a6c242ae0ed31e69559f7684db3f83932a07b (diff) |
live: clear ogbrowser logs before image_restore
Clears content of blue text areas in the real time log view before
executing a restore image operation.
Adds private function _ogbrowser_clear_logs, this function writes to a
couple of text files present in the ogLive environment.
The contents of this file are printed out to the blue text areas
in the "real time log" view.
-rw-r--r-- | src/live/ogOperations.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index 61da45b..bfa54c5 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -181,6 +181,12 @@ class OgLiveOperations: proc_lzop.stdout.close() proc_pc.communicate() + def _ogbrowser_clear_logs(self): + logfiles = ['/tmp/command.log', '/tmp/session.log'] + for logfile in logfiles: + with open(logfile, 'wb', 0) as f: + f.truncate(0) + def poweroff(self): logging.info('Powering off client') if os.path.exists('/scripts/oginit'): @@ -329,9 +335,9 @@ class OgLiveOperations: ctype = request.getType() profile = request.getProfile() cid = request.getId() - partdev = get_partition_device(int(disk), int(partition)) + self._ogbrowser_clear_logs() self._restartBrowser(self._url_log) logging.debug('Image restore params:') |