From c651c88eacf9c3bbf1f037be3a5dc0425308c730 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Mon, 21 Nov 2011 16:00:19 -0800 Subject: [PATCH] Properly handle case where first error is inside a context manager __exit__. Closes: http://tracker.newdream.net/issues/1743 --- teuthology/run_tasks.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/teuthology/run_tasks.py b/teuthology/run_tasks.py index 4466202c45..446493d703 100644 --- a/teuthology/run_tasks.py +++ b/teuthology/run_tasks.py @@ -48,6 +48,11 @@ def run_tasks(tasks, ctx): if 'failure_reason' not in ctx.summary: ctx.summary['failure_reason'] = str(e) log.exception('Manager failed: %s', manager) + + if exc_info == (None, None, None): + # if first failure is in an __exit__, we don't + # have exc_info set yet + exc_info = sys.exc_info() else: if suppress: sys.exc_clear() -- 2.39.5