Convergence: Fix stack status_reason

This is needed to fix the following functional test:
test_template_resource.TemplateResourceErrorMessageTest.test_fail

Change-Id: I90d6e6f688c214a73c043aa88d0a25fc0b2ebc83
This commit is contained in:
Angus Salkeld 2015-06-30 11:15:37 +10:00
parent ae0077df4d
commit afe920e0ce
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(