Modify the message of ERROR in stack_cancel_update()

Difficult to understand the ERROR.

TrivialFix

Change-Id: Idb19dc95ddb0c74915d9dfd28c1c20e122a7d217
Closes-Bug: #1555425
This commit is contained in:
PanFengyun 2016-03-10 12:01:42 +08:00
parent e37e73e63d
commit 415175ca8a
2 changed files with 3 additions and 2 deletions

View File

@ -1092,8 +1092,9 @@ class EngineService(service.Service):
current_stack = parser.Stack.load(cnxt, stack=db_stack)
if current_stack.state != (current_stack.UPDATE,
current_stack.IN_PROGRESS):
state = '_'.join(current_stack.state)
msg = _("Cancelling update when stack is %s"
) % str(current_stack.state)
) % str(state)
raise exception.NotSupported(feature=msg)
LOG.info(_LI('Starting cancel of updating stack %s'), db_stack.name)
# stop the running update and take the lock

View File

@ -407,7 +407,7 @@ class ServiceStackUpdateTest(common.HeatTestCase):
self.assertEqual(exception.NotSupported, ex.exc_info[0])
self.assertIn("Cancelling update when stack is "
"('UPDATE', 'COMPLETE')",
"UPDATE_COMPLETE",
six.text_type(ex.exc_info[1]))
@mock.patch.object(stack_object.Stack, 'count_total_resources')