I am worried about how to pass json format output to the next task.
Get EC2 instance creation result as follows.
"Reservations": [
{
"Instances": [
{
"Monitoring": {
"State": "disabled"
},
"PublicDnsName": "ec2-XXX-XXX-XXX-XXX.ap-northeast-1.compute.amazonaws.com",
"State": {
:
The result is standard output by python program as follows.
print(responce)
Then PUBLISH the first task in the workflow and try to use it in task2.
task1:
:
publish:
json_result: "<% task(task1).result.stdout %>"
on-success:
- task2
task2:
action: core.local
input:
cmd: "echo <% $.result.Reservations[0].Instances[0].PublicDnsName %> >> /data/ec2.log"
However, executing this workflow results in the following error:
"state_info": "Failed to run task [error=Can not evaluate YAQL expression [expression=task(task1).result.stdout.Reservations[0].Instances[0].PublicDnsName, error=Unknown function \"#property#Reservations\", data={}], wf=hmpack.deploy_machine.main, task=task2]:
Traceback (most recent call last):
File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/mistral/engine/task_handler.py\", line 63, in run_task
task.run()
File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/osprofiler/profiler.py\", line 160, in wrapper
result = f(*args, **kwargs)
File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/mistral/engine/tasks.py\", line 374, in run
self._run_new()
File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/osprofiler/profiler.py\", line 160, in wrapper
I’m worried for a while, but I don’t know the cause. Could you tell me the cause?