Update resource statuses in the database

This ensures that resources will not get deleted multiple times when
something else fails during stack deletion.

Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
Zane Bitter 2012-05-23 20:34:54 +02:00
parent c63965b3a0
commit 5467f40da3
1 changed files with 3 additions and 0 deletions

View File

@ -119,6 +119,9 @@ class Resource(object):
except Exception as ex:
logger.warn('db error %s' % str(ex))
elif new_state is not self.CREATE_IN_PROGRESS:
rs = db_api.resource_get(None, self.id)
rs.update_and_save({'state': new_state})
if new_state != self.state:
ev = {}