mirror of https://git.48k.eu/ogclient
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.more_events
parent
699a6c242a
commit
70f1d0d71d
|
@ -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:')
|
||||
|
|
Loading…
Reference in New Issue