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
This commit is contained in:
Pavlo Shchelokovskyy 2015-01-15 11:02:23 +00:00
parent bac63f6144
commit e44629dab0
1 changed files with 3 additions and 3 deletions

View File

@ -848,9 +848,9 @@ class Stack(collections.Mapping):
# these stacks. curr_res is the resource that just
# created and failed, so put into the stack to delete anyway.
backup_res_id = backup_res.resource_id
curr_res = self.resources[key]
curr_res_id = curr_res.resource_id
if backup_res_id:
curr_res = self.resources.get(key)
if backup_res_id is not None and curr_res is not None:
curr_res_id = curr_res.resource_id
if (any(failed(child) for child in
self.dependencies[curr_res]) or
curr_res.status in