Clean up duplicate workflow messages for plan actions
Currently, on success we get messages both from the YAML workflow and print statements from the client itself, resulting in duplicate messages (e.g. "Plan updated." followed by "Plan updated" right after.) This removes the duplicate messages from the client side, only keeping the messages coming from the workflows. Change-Id: If50498e6a543b9819b19b6888efa3dcd84a20c56
This commit is contained in:
parent
0d4c8493d9
commit
838be92e0c
@ -74,9 +74,7 @@ def create_default_plan(clients, **workflow_input):
|
|||||||
if 'message' in payload:
|
if 'message' in payload:
|
||||||
print(payload['message'])
|
print(payload['message'])
|
||||||
|
|
||||||
if payload['status'] == 'SUCCESS':
|
if payload['status'] != 'SUCCESS':
|
||||||
print("Default plan created")
|
|
||||||
else:
|
|
||||||
raise exceptions.WorkflowServiceError(
|
raise exceptions.WorkflowServiceError(
|
||||||
'Exception creating plan: {}'.format(payload['message']))
|
'Exception creating plan: {}'.format(payload['message']))
|
||||||
|
|
||||||
@ -105,12 +103,7 @@ def create_deployment_plan(clients, **workflow_input):
|
|||||||
clients, 'tripleo.plan_management.v1.create_deployment_plan',
|
clients, 'tripleo.plan_management.v1.create_deployment_plan',
|
||||||
**workflow_input)
|
**workflow_input)
|
||||||
|
|
||||||
if payload['status'] == 'SUCCESS':
|
if payload['status'] != 'SUCCESS':
|
||||||
if 'use_default_templates' in workflow_input:
|
|
||||||
print("Default plan created")
|
|
||||||
else:
|
|
||||||
print("Plan created")
|
|
||||||
else:
|
|
||||||
raise exceptions.WorkflowServiceError(
|
raise exceptions.WorkflowServiceError(
|
||||||
'Exception creating plan: {}'.format(payload['message']))
|
'Exception creating plan: {}'.format(payload['message']))
|
||||||
|
|
||||||
@ -132,9 +125,7 @@ def update_deployment_plan(clients, **workflow_input):
|
|||||||
clients, 'tripleo.plan_management.v1.update_deployment_plan',
|
clients, 'tripleo.plan_management.v1.update_deployment_plan',
|
||||||
**workflow_input)
|
**workflow_input)
|
||||||
|
|
||||||
if payload['status'] == 'SUCCESS':
|
if payload['status'] != 'SUCCESS':
|
||||||
print("Plan updated")
|
|
||||||
else:
|
|
||||||
raise exceptions.WorkflowServiceError(
|
raise exceptions.WorkflowServiceError(
|
||||||
'Exception updating plan: {}'.format(payload['message']))
|
'Exception updating plan: {}'.format(payload['message']))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user