Support multiple messages from delete_node

This updates the workflow wrapper to use the multiple message interface.

Change-Id: I1b4ace2cef45f4aa979e26f4ba88aea6a17bd03e
Partial-Bug: #1646887
changes/38/446438/4
Dougal Matthews 6 years ago
parent af4e0726ce
commit fcf8c4d4cb
  1. 14
      tripleoclient/tests/v1/overcloud_node/test_overcloud_node.py
  2. 7
      tripleoclient/workflows/scale.py

@ -63,9 +63,10 @@ class TestDeleteNode(fakes.TestDeleteNode):
]
parsed_args = self.check_parser(self.cmd, argslist, verifylist)
self.websocket.wait_for_message.return_value = {
self.websocket.wait_for_messages.return_value = iter([{
"execution": {"id": "IDID"},
"status": "SUCCESS"
}
}])
self.stack_name.return_value = mock.Mock(stack_name="overcast")
@ -112,9 +113,10 @@ class TestDeleteNode(fakes.TestDeleteNode):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.websocket.wait_for_message.return_value = {
self.websocket.wait_for_messages.return_value = iter([{
"execution": {"id": "IDID"},
"status": "SUCCESS"
}
}])
self.cmd.take_action(parsed_args)
@ -137,11 +139,11 @@ class TestDeleteNode(fakes.TestDeleteNode):
]
parsed_args = self.check_parser(self.cmd, argslist, verifylist)
self.websocket.wait_for_message.return_value = {
self.websocket.wait_for_messages.return_value = iter([{
"status": "FAILED",
"message": """Failed to run action ERROR: Couldn't find \
following instances in stack overcloud: wrong_instance"""
}
}])
self.assertRaises(exceptions.InvalidConfiguration,
self.cmd.take_action, parsed_args)

@ -33,9 +33,10 @@ def delete_node(clients, **workflow_input):
)
with tripleoclients.messaging_websocket(queue_name) as ws:
rtn_message = ws.wait_for_message(execution.id)
if rtn_message['status'] != "SUCCESS":
raise InvalidConfiguration(rtn_message['message'])
for payload in base.wait_for_messages(workflow_client, ws, execution,
360):
if payload['status'] != "SUCCESS":
raise InvalidConfiguration(payload['message'])
def scale_down(clients, plan_name, nodes, timeout=None):

Loading…
Cancel
Save