Don't exit on a RUNNING message for deploy workflow

This workflow is being updated to return a RUNNING status when the
workflow starts, so we don't want to assert that SUCCESS is the only
valid outcome anymore.

Related blueprint config-download-workflows

Co-Authored-By: Dougal Matthews <dougal@redhat.com>
Closes-Bug: #1766216
Change-Id: I78b4fc7673a4039ed7ef32b16bb2850411f7fcc6
(cherry picked from commit 624037db01)
This commit is contained in:
Steven Hardy 2018-03-28 15:22:00 +01:00 committed by Luke Short
parent e11afa0b58
commit 98a8278007
1 changed files with 11 additions and 3 deletions

View File

@ -37,11 +37,12 @@ def deploy(clients, **workflow_input):
workflow_client = clients.workflow_engine
tripleoclients = clients.tripleoclient
wf_name = 'tripleo.deployment.v1.deploy_plan'
with tripleoclients.messaging_websocket() as ws:
execution = base.start_workflow(
workflow_client,
'tripleo.deployment.v1.deploy_plan',
wf_name,
workflow_input=workflow_input
)
@ -49,8 +50,15 @@ def deploy(clients, **workflow_input):
# means that is shouldn't take very long. Wait for 10 minutes for
# messages from the workflow.
for payload in base.wait_for_messages(workflow_client, ws, execution,
600):
assert payload['status'] == "SUCCESS", pprint.pformat(payload)
360):
status = payload.get('status', 'RUNNING')
if 'message' in payload and status == "RUNNING":
print(payload['message'])
if payload['status'] != "SUCCESS":
pprint.pformat(payload)
raise ValueError("Unexpected status %s for %s"
% (payload['status'], wf_name))
def deploy_and_wait(log, clients, stack, plan_name, verbose_level,