When a stack update fails, Heat stores a merged environment file containing the previous and new environments with the stack. However, previously, if the update was prematurely interrupted (for instance, by restarting heat-engine) the merged environment file was not written. As a result, if an update was interrupted, any resources already created that had new type aliases in the environment could not have their types resolved, and thus the failed stack could no longer be updated.
This patch catches any exceptions (including exit exceptions) that occur while updating a stack and ensure that the merged environment is written. Thereby, after a stack update is interrupted subsequent to resources with new type aliases being created, the stack can now be updated again.