Merge "Convergence: Fix stack status_reason"

This commit is contained in:
Jenkins 2015-07-02 08:31:22 +00:00 committed by Gerrit Code Review
commit df3845afbf
2 changed files with 10 additions and 6 deletions

View File

@ -178,8 +178,9 @@ class WorkerService(service.Service):
current_traversal,
data, is_update)
return
except exception.ResourceFailure as e:
reason = six.text_type(e)
except exception.ResourceFailure as ex:
reason = 'Resource %s failed: %s' % (stack.action,
six.text_type(ex))
self._handle_resource_failure(
cnxt, stack.id, current_traversal, reason)
return
@ -195,8 +196,9 @@ class WorkerService(service.Service):
current_traversal,
data, is_update)
return
except exception.ResourceFailure as e:
reason = six.text_type(e)
except exception.ResourceFailure as ex:
reason = 'Resource %s failed: %s' % (stack.action,
six.text_type(ex))
self._handle_resource_failure(
cnxt, stack.id, current_traversal, reason)
return

View File

@ -203,7 +203,8 @@ class CheckWorkflowUpdateTest(common.HeatTestCase):
self.is_update)
s = self.stack.load(self.ctx, stack_id=self.stack.id)
self.assertEqual((s.UPDATE, s.FAILED), (s.action, s.status))
self.assertEqual(u'ResourceNotAvailable: resources.A: The Resource (A)'
self.assertEqual('Resource UPDATE failed: '
'ResourceNotAvailable: resources.A: The Resource (A)'
' is not available.', s.status_reason)
def test_resource_cleanup_failure_sets_stack_state_as_failed(
@ -220,7 +221,8 @@ class CheckWorkflowUpdateTest(common.HeatTestCase):
self.is_update)
s = self.stack.load(self.ctx, stack_id=self.stack.id)
self.assertEqual((s.UPDATE, s.FAILED), (s.action, s.status))
self.assertEqual(u'ResourceNotAvailable: resources.A: The Resource (A)'
self.assertEqual('Resource UPDATE failed: '
'ResourceNotAvailable: resources.A: The Resource (A)'
' is not available.', s.status_reason)
def test_resource_update_failure_triggers_rollback_if_enabled(