Merge "Fix node 'op' operation return vaule miss 'action'"

This commit is contained in:
Zuul 2018-05-28 01:39:32 +00:00 committed by Gerrit Code Review
commit f0d378ac64
2 changed files with 7 additions and 4 deletions

View File

@ -217,5 +217,6 @@ class NodeController(wsgi.Controller):
action_id = node.pop('action')
result = {
'location': '/actions/%s' % action_id,
'action': action_id
}
return result

View File

@ -1009,11 +1009,13 @@ class NodeControllerTest(shared.ControllerTest, base.SenlinTestCase):
mock_parse.return_value = obj
mock_call.return_value = engine_response
response = self.controller.operation(req, node_id=node_id, body=body)
response = self.controller.operation(req, node_id=node_id,
body=body)
location = {'location': '/actions/action-id'}
engine_response.update(location)
self.assertEqual(engine_response, response)
expected_response = {'location': '/actions/action-id',
'action': 'action-id'}
self.assertEqual(response, expected_response)
mock_parse.assert_called_once_with(
'NodeOperationRequest', req,
{'identity': 'xxxx-yyyy',