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
This commit is contained in:
Steven Hardy 2018-03-28 15:22:00 +01:00 committed by James Slagle
parent 241af16e70
commit 624037db01
1 changed files with 10 additions and 2 deletions

View File

@ -30,11 +30,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
)
@ -43,7 +44,14 @@ def deploy(clients, **workflow_input):
# messages from the workflow.
for payload in base.wait_for_messages(workflow_client, ws, execution,
360):
assert payload['status'] == "SUCCESS", pprint.pformat(payload)
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,