stack.update(values)
stack.save(_session(context))
- # When the raw_template ID changes, we delete the old template
- # after storing the new template ID
- if stack.raw_template_id != old_template_id:
- session = Session.object_session(stack)
- rt = raw_template_get(context, old_template_id)
- session.delete(rt)
- session.flush()
-
def stack_delete(context, stack_id):
s = stack_get(context, stack_id)
'Stack %s started' % action)
oldstack = Stack(self.context, self.name, self.t, self.env)
+ backup_stack = self._backup_stack()
+
try:
- update_task = update.StackUpdate(self, newstack, oldstack)
+ update_task = update.StackUpdate(self, newstack, backup_stack)
updater = scheduler.TaskRunner(update_task)
self.env = newstack.env
if not self.disable_rollback:
self.update(oldstack, action=self.ROLLBACK)
return
+ else:
+ logger.debug('Deleting backup stack')
+ backup_stack.delete()
self.state_set(action, stack_status, reason)