Return an empty log if the value is None

This commit is contained in:
Joshua Boniface 2021-07-09 13:08:00 -04:00
parent 5ffabcfef5
commit c0c9327a7d
1 changed files with 3 additions and 0 deletions

View File

@ -791,6 +791,9 @@ def get_console_log(zkhandler, domain, lines=1000):
# Get the data from ZK
console_log = zkhandler.read(('domain.log.console', dom_uuid))
if console_log is None:
return True, ''
# Shrink the log buffer to length lines
shrunk_log = console_log.split('\n')[-lines:]
loglines = '\n'.join(shrunk_log)