diff --git a/tripleoclient/tests/workflows/test_baremetal.py b/tripleoclient/tests/workflows/test_baremetal.py index 912d5ef0f..9e795649d 100644 --- a/tripleoclient/tests/workflows/test_baremetal.py +++ b/tripleoclient/tests/workflows/test_baremetal.py @@ -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, diff --git a/tripleoclient/workflows/baremetal.py b/tripleoclient/workflows/baremetal.py index cc9f82fe5..dbb812dcb 100644 --- a/tripleoclient/workflows/baremetal.py +++ b/tripleoclient/workflows/baremetal.py @@ -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.')