Merge "Always replace a failed resource on rollback"
This commit is contained in:
commit
99a11f8633
|
@ -622,6 +622,9 @@ class Resource(object):
|
|||
|
||||
def _needs_update(self, after, before, after_props, before_props,
|
||||
prev_resource):
|
||||
if self.status == self.FAILED:
|
||||
raise UpdateReplace(self)
|
||||
|
||||
if prev_resource is not None:
|
||||
cur_class_def, cur_ver = self.implementation_signature()
|
||||
prev_class_def, prev_ver = prev_resource.implementation_signature()
|
||||
|
|
|
@ -2711,8 +2711,12 @@ class StackTest(HeatTestCase):
|
|||
disable_rollback=False)
|
||||
|
||||
# patch in a dummy delete making the destroy fail
|
||||
self.m.StubOutWithMock(generic_rsrc.ResourceWithProps, 'handle_create')
|
||||
self.m.StubOutWithMock(generic_rsrc.ResourceWithProps, 'handle_delete')
|
||||
generic_rsrc.ResourceWithProps.handle_delete().AndRaise(Exception)
|
||||
# replace the failed resource on rollback
|
||||
generic_rsrc.ResourceWithProps.handle_create()
|
||||
generic_rsrc.ResourceWithProps.handle_delete()
|
||||
self.m.ReplayAll()
|
||||
|
||||
self.stack.update(updated_stack)
|
||||
|
|
Loading…
Reference in New Issue