From d889c0b607c3337b369d073a4ae8205109297c20 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 2 Aug 2013 00:05:08 -0700 Subject: [PATCH] Deep-copy not always possible. In working with cinder it appears that at last cinder is using objects which can not be deep copied (sqlalchemy objects) and which actually cause the deepcopy routine to fail. To get around this avoid the deepcopy until proven its really needed. Change-Id: Ia7b7c49e82c2151351cc0f78ecb1531c35540652 --- taskflow/patterns/linear_flow.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/taskflow/patterns/linear_flow.py b/taskflow/patterns/linear_flow.py index 96ef74e9..661bda2b 100644 --- a/taskflow/patterns/linear_flow.py +++ b/taskflow/patterns/linear_flow.py @@ -17,7 +17,6 @@ # under the License. import collections -import copy import logging from taskflow.openstack.common import excutils @@ -193,18 +192,9 @@ class Flow(base.Flow): # notifying others that the task has finished to # avoid the case where a listener might throw an # exception. - # - # Note(harlowja): Keep the original result in the - # accumulator only and give a duplicated copy to - # avoid the original result being altered by other - # tasks. - # - # This is due to python being by reference (which means - # some task could alter this result intentionally or not - # intentionally). rb.result = result runner.result = result - self.results[runner.uuid] = copy.deepcopy(result) + self.results[runner.uuid] = result self.task_notifier.notify(states.SUCCESS, details={ 'context': context, 'flow': self,