From 5e0e49eefbe0a477c66edd3fef610c90bdf27d3a Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 3 Jun 2013 21:19:44 -0700 Subject: [PATCH] Ensure we have an exception and capture the exc_info. --- taskflow/patterns/ordered_flow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/taskflow/patterns/ordered_flow.py b/taskflow/patterns/ordered_flow.py index 980d9bb5..96c9421b 100644 --- a/taskflow/patterns/ordered_flow.py +++ b/taskflow/patterns/ordered_flow.py @@ -21,6 +21,7 @@ import collections import copy import functools import logging +import sys from taskflow.openstack.common import excutils from taskflow import exceptions as exc @@ -34,10 +35,11 @@ class FlowFailure(object): """When a task failure occurs the following object will be given to revert and can be used to interrogate what caused the failure.""" - def __init__(self, task, flow, exception=None): + def __init__(self, task, flow, exception): self.task = task self.flow = flow - self.exception = exception + self.exc = exception + self.exc_info = sys.exc_info() class RollbackTask(object):