From 194a642c15e500f6cac5828c34eab1790657ae20 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 15 Jan 2020 00:47:14 -0500 Subject: [PATCH] Report errors in log -f --- client-cli/cli_lib/vm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client-cli/cli_lib/vm.py b/client-cli/cli_lib/vm.py index e75dbc82..70763546 100644 --- a/client-cli/cli_lib/vm.py +++ b/client-cli/cli_lib/vm.py @@ -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:]