Support multiple messages from introspect workflow
This updates the workflow wrapper to use the multiple message interface. Change-Id: I065652693a1c15e8cad9a06f715a0d5306ff828f Partial-Bug: #1646887
This commit is contained in:
parent
17f20bdaa6
commit
f71fc36a3c
|
@ -145,10 +145,7 @@ class TestBaremetalWorkflows(utils.TestCommand):
|
|||
|
||||
def test_introspect_success(self):
|
||||
|
||||
self.websocket.wait_for_message.return_value = {
|
||||
"status": "SUCCESS",
|
||||
"introspected_nodes": {}
|
||||
}
|
||||
self.websocket.wait_for_messages.return_value = self.message_success
|
||||
|
||||
baremetal.introspect(self.app.client_manager, node_uuids=[],
|
||||
run_validations=True, queue_name="QUEUE_NAME")
|
||||
|
@ -163,11 +160,7 @@ class TestBaremetalWorkflows(utils.TestCommand):
|
|||
|
||||
def test_introspect_error(self):
|
||||
|
||||
self.websocket.wait_for_message.return_value = {
|
||||
"status": "FAIL",
|
||||
"message": "Failed",
|
||||
"introspected_nodes": {}
|
||||
}
|
||||
self.websocket.wait_for_messages.return_value = self.message_failed
|
||||
|
||||
self.assertRaises(
|
||||
exceptions.IntrospectionError,
|
||||
|
|
|
@ -116,7 +116,9 @@ def introspect(clients, **workflow_input):
|
|||
print("Waiting for introspection to finish...")
|
||||
|
||||
with tripleoclients.messaging_websocket(queue_name) as ws:
|
||||
payload = ws.wait_for_message(execution.id)
|
||||
for payload in base.wait_for_messages(workflow_client, ws, execution):
|
||||
if 'message' in payload:
|
||||
print(payload['message'])
|
||||
|
||||
if payload['status'] == 'SUCCESS':
|
||||
print('Successfully introspected all nodes.')
|
||||
|
|
Loading…
Reference in New Issue