summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Shchelokovskyy <pshchelokovskyy@mirantis.com>2015-01-15 11:02:23 +0000
committerZane Bitter <zbitter@redhat.com>2015-09-23 20:48:35 -0400
commitfe5333395c3ff3f4be4bc6393fca673e38b21cc3 (patch)
treeccfea4688ab3de9b117a12ca5b739b587ce4bfcb
parent3a3b74ad1c01a2bb3b36b1d76280dd9857636340 (diff)
downloadheat-fe5333395c3ff3f4be4bc6393fca673e38b21cc3.tar.gz
Prevent hanging in DELETE_IN_PROGRESS
When during update one resource is deleted and another independent resource takes long to update itself, deleting such stack when it is UPDATE_IN_PROGRESS led to a stack being stuck in DELETE_IN_PROGRESS as deleting backup stack was not finding the already deleted resource. Change-Id: Ib0c42b718a88ac994c53165362a38da2ad5b6b41 Closes-Bug: #1384750 (cherry picked from commit e44629dab01057c65a14218f5d3ae19d5cdcf9e0)
-rw-r--r--heat/engine/stack.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/heat/engine/stack.py b/heat/engine/stack.py
index c0d6a8ea5..608b4e1da 100644
--- a/heat/engine/stack.py
+++ b/heat/engine/stack.py
@@ -835,9 +835,10 @@ class Stack(collections.Mapping):
# created and failed, so put into the backup_stack to delete
# anyway.
backup_resource_id = backup_resource.resource_id
- current_resource = self.resources[key]
- current_resource_id = current_resource.resource_id
- if backup_resource_id:
+ current_resource = self.resources.get(key)
+ if (backup_resource_id is not None and
+ current_resource is not None):
+ current_resource_id = current_resource.resource_id
if (any(failed(child) for child in
self.dependencies[current_resource]) or
current_resource.status in