Report errors in log -f

This commit is contained in:
Joshua Boniface 2020-01-15 00:47:14 -05:00
parent 4c1b78d7a4
commit 194a642c15
1 changed files with 3 additions and 0 deletions

View File

@ -276,6 +276,9 @@ def follow_console_log(config, vm, lines=10):
}
response = call_api(config, 'get', '/vm/{vm}/console'.format(vm=vm), params=params)
if response.status_code != 200:
return False, response.json()['message']
# Shrink the log buffer to length lines
console_log = response.json()['data']
shrunk_log = console_log.split('\n')[-lines:]