From 1500e11a6f22bf815f3dd10d252ff0fb7697f12f Mon Sep 17 00:00:00 2001 From: Lucas Meneghel Rodrigues Date: Mon, 9 Jun 2014 13:29:54 -0300 Subject: [PATCH] avocado.plugins.vm: Provide better debug info on failures to load JSON Provide the full output of the avocado execution, so we understand better what was the actual failure. Signed-off-by: Lucas Meneghel Rodrigues --- avocado/plugins/vm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/avocado/plugins/vm.py b/avocado/plugins/vm.py index 719ade6a..1ee29225 100644 --- a/avocado/plugins/vm.py +++ b/avocado/plugins/vm.py @@ -52,7 +52,12 @@ class VMTestRunner(TestRunner): """ avocado_cmd = 'avocado --json run --archive "%s"' % urls stdout = self.result.vm.remote.run(avocado_cmd) - results = json.loads(stdout) + try: + results = json.loads(stdout) + except Exception, details: + raise ValueError('Error loading JSON ' + '(full output below): %s\n"""\n%s\n"""' % + (details, stdout)) return results def run(self, params_list): -- GitLab