From aa6549028957d6d29bfa43f6e3f2f4d578e8dcb7 Mon Sep 17 00:00:00 2001 From: Stan Lagun Date: Thu, 15 Sep 2016 08:27:07 -0700 Subject: [PATCH] Fixes ObjectDestroyedError on StackTrace object When deployment fails instead of original error there is a "ObjectDestroyedError: Object is already destroyed" exception raised and deployment hangs Change-Id: I20f6830cc02ebbdd480716ad3ac3f6ae44016ff4 Closes-Bug: #1624008 --- murano/common/engine.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/murano/common/engine.py b/murano/common/engine.py index ee607829..321c94dd 100644 --- a/murano/common/engine.py +++ b/murano/common/engine.py @@ -245,16 +245,13 @@ class TaskExecutor(object): try: LOG.debug('Invoking pre-execution hooks') self.session.start() - try: - action_result = self._invoke(executor) - finally: - self._model = executor.finalize(obj) - + action_result = self._invoke(executor) except Exception as e: return self.exception_result(e, obj, self.action['method']) finally: LOG.debug('Invoking post-execution hooks') self.session.finish() + self._model = executor.finalize(obj) try: action_result = serializer.serialize(action_result, executor) except Exception as e: