From a23cd0d82bdd64c16ada31ad7f31f8beef644a6d Mon Sep 17 00:00:00 2001 From: Nikolay Mahotkin Date: Wed, 22 Oct 2014 13:37:40 +0400 Subject: [PATCH] Fix passing workflow input via UI * When we are using UI to pass workflow input to execution, we always pass it as json string. We need to prevent using extra json.dumps on string. Change-Id: Ie11c342b305a1359f9a28d354230f515d36e7a0c --- mistralclient/api/v2/executions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mistralclient/api/v2/executions.py b/mistralclient/api/v2/executions.py index 8f3b54d0..b1bb1c71 100644 --- a/mistralclient/api/v2/executions.py +++ b/mistralclient/api/v2/executions.py @@ -13,6 +13,7 @@ # limitations under the License. import json +import six from mistralclient.api import base @@ -30,7 +31,10 @@ class ExecutionManager(base.ResourceManager): data = {'workflow_name': workflow_name} if workflow_input: - data.update({'input': json.dumps(workflow_input)}) + if isinstance(workflow_input, six.string_types): + data.update({'input': workflow_input}) + else: + data.update({'input': json.dumps(workflow_input)}) if params: data.update({'params': json.dumps(params)})