Fix input on execution create

This fix apparently broke it
https://review.openstack.org/#/c/121510/4/mistral/api/controllers/v2/execution.py

Added the dict to unit-tests.
Tested with client: mistral execution-create wb1.wf1 '{ "str1":"foo", "str2":"bar" }'

Change-Id: I75be2ab35210f1a7f1bdca1a18c1f7f375862d27
This commit is contained in:
Dmitri Zimine 2014-09-17 21:23:04 -07:00
parent 45947ac2e4
commit bbb1efbc1c
2 changed files with 5 additions and 2 deletions

View File

@ -49,6 +49,9 @@ class Execution(resource.Resource):
def to_dict(self): def to_dict(self):
d = super(Execution, self).to_dict() d = super(Execution, self).to_dict()
if d.get('input'):
d['input'] = json.loads(d['input'])
if d.get('output'): if d.get('output'):
d['output'] = json.loads(d['output']) d['output'] = json.loads(d['output'])

View File

@ -32,7 +32,7 @@ EXEC_DB = models.Execution(
wf_name='some', wf_name='some',
wf_spec={'name': 'some'}, wf_spec={'name': 'some'},
state=states.RUNNING, state=states.RUNNING,
input={}, input={'foo': 'bar'},
output={}, output={},
created_at=datetime.datetime(1970, 1, 1), created_at=datetime.datetime(1970, 1, 1),
updated_at=datetime.datetime(1970, 1, 1) updated_at=datetime.datetime(1970, 1, 1)
@ -40,7 +40,7 @@ EXEC_DB = models.Execution(
EXEC = { EXEC = {
'id': '123', 'id': '123',
'input': '{}', 'input': '{"foo": "bar"}',
'output': '{}', 'output': '{}',
'state': 'RUNNING', 'state': 'RUNNING',
'created_at': '1970-01-01 00:00:00', 'created_at': '1970-01-01 00:00:00',