Fixed execution create method
* Fixed passing 'params' and 'input' parameters to API Change-Id: Ic28e4a727f2fc2f454c02ed03ff17a7da00eb0d1
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
from mistralclient.api import base
|
from mistralclient.api import base
|
||||||
|
|
||||||
|
|
||||||
@@ -28,9 +30,10 @@ class ExecutionManager(base.ResourceManager):
|
|||||||
data = {'workflow_name': workflow_name}
|
data = {'workflow_name': workflow_name}
|
||||||
|
|
||||||
if workflow_input:
|
if workflow_input:
|
||||||
data.update({'workflow_input': workflow_input})
|
data.update({'input': json.dumps(workflow_input)})
|
||||||
|
|
||||||
data.update(params)
|
if params:
|
||||||
|
data.update({'params': json.dumps(params)})
|
||||||
|
|
||||||
return self._create('/executions', data)
|
return self._create('/executions', data)
|
||||||
|
|
||||||
|
@@ -24,14 +24,12 @@ EXEC = {
|
|||||||
'id': "123",
|
'id': "123",
|
||||||
'workflow_name': 'my_wf',
|
'workflow_name': 'my_wf',
|
||||||
'state': 'RUNNING',
|
'state': 'RUNNING',
|
||||||
'workflow_input': """
|
'input': {
|
||||||
{
|
"person": {
|
||||||
"person": {
|
"first_name": "John",
|
||||||
"first_name": "John",
|
"last_name": "Doe"
|
||||||
"last_name": "Doe"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"""
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -44,11 +42,11 @@ class TestExecutionsV2(base.BaseClientV2Test):
|
|||||||
mock = self.mock_http_post(content=EXEC)
|
mock = self.mock_http_post(content=EXEC)
|
||||||
body = {
|
body = {
|
||||||
'workflow_name': EXEC['workflow_name'],
|
'workflow_name': EXEC['workflow_name'],
|
||||||
'workflow_input': EXEC['workflow_input'],
|
'input': json.dumps(EXEC['input']),
|
||||||
}
|
}
|
||||||
|
|
||||||
ex = self.executions.create(EXEC['workflow_name'],
|
ex = self.executions.create(EXEC['workflow_name'],
|
||||||
EXEC['workflow_input'])
|
EXEC['input'])
|
||||||
|
|
||||||
self.assertIsNotNone(ex)
|
self.assertIsNotNone(ex)
|
||||||
self.assertEqual(executions.Execution(self.executions, EXEC).__dict__,
|
self.assertEqual(executions.Execution(self.executions, EXEC).__dict__,
|
||||||
|
Reference in New Issue
Block a user