Merge "Handle re-created resources in StackUpdateManager" into stable/newton

This commit is contained in:
Jenkins 2017-06-09 11:28:43 +00:00 committed by Gerrit Code Review
commit fb27e73b32
2 changed files with 6 additions and 9 deletions

View File

@ -160,9 +160,11 @@ class StackUpdateManager(object):
state = 'on_breakpoint'
elif ev.resource_status_reason == hook_clear_reason:
state = 'in_progress'
elif ev.resource_status == 'UPDATE_IN_PROGRESS':
elif ev.resource_status in ('CREATE_IN_PROGRESS',
'UPDATE_IN_PROGRESS'):
state = 'in_progress'
elif ev.resource_status == 'UPDATE_COMPLETE':
elif ev.resource_status in ('CREATE_COMPLETE',
'UPDATE_COMPLETE'):
state = 'completed'
resources[state][res.physical_resource_id] = res

View File

@ -53,14 +53,9 @@ class StackUpdateManagerTest(base.TestCase):
mock.MagicMock(
event_time='2015-03-25T09:15:04Z',
resource_name='Controller-0',
resource_status='CREATE_IN_PROGRESS',
resource_status='UPDATE_IN_PROGRESS',
resource_status_reason='UPDATE paused until Hook '
'pre-update is cleared'),
mock.MagicMock(
event_time='2015-03-25T09:15:02Z',
resource_name='Controller-1',
resource_status='CREATE_COMPLETE',
resource_status_reason=''),
'pre-update is cleared')
]
else:
return [