Use sync action get_deployment_failures
Instead of using the workflow, which has the extra overhead of opening a websocket and polling for messages and the workflow result, just use the mistral action for get_deployment_failures directly. This is much simpler. It also fixes a bug where messages from other running workflows using the same "tripleo" queue were polluting the output of the "overcloud failures" command. Change-Id: Ie774a5698515ba7e43dc0755042fb476eb241fc7 Closes-Bug: #1794277
This commit is contained in:
parent
2a26ef2cf1
commit
ec2e018457
@ -345,23 +345,14 @@ def get_deployment_status(clients, **workflow_input):
|
||||
|
||||
def get_deployment_failures(clients, **workflow_input):
|
||||
workflow_client = clients.workflow_engine
|
||||
tripleoclients = clients.tripleoclient
|
||||
|
||||
with tripleoclients.messaging_websocket() as ws:
|
||||
execution = base.start_workflow(
|
||||
workflow_client,
|
||||
'tripleo.deployment.v1.get_deployment_failures',
|
||||
workflow_input=workflow_input
|
||||
)
|
||||
result = base.call_action(
|
||||
workflow_client,
|
||||
'tripleo.deployment.get_deployment_failures',
|
||||
**workflow_input
|
||||
)
|
||||
|
||||
for payload in base.wait_for_messages(workflow_client, ws, execution,
|
||||
_WORKFLOW_TIMEOUT):
|
||||
if 'message' in payload:
|
||||
print(payload['message'])
|
||||
if result.get('message', ''):
|
||||
print(result['message'])
|
||||
|
||||
if payload['status'] == 'SUCCESS':
|
||||
return payload['deployment_failures']['failures']
|
||||
else:
|
||||
raise exceptions.WorkflowServiceError(
|
||||
'Exception getting deployment failures: {}'.format(
|
||||
payload.get('message', '')))
|
||||
return result['failures']
|
||||
|
Loading…
x
Reference in New Issue
Block a user