Need to handle error during YAQL evalution if non-defined variable was called

Bug #1449505 reported by Anastasia Kuznetsova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Nikolay Makhotkin
Liberty
Fix Released
Medium
Nikolay Makhotkin

Bug Description

Steps to reproduce:
1. Create workflow definition
For example:
---
version: "2.0"

wf_main:

  tasks:
    invoke_wf:
      with-items:
       - i in [1, 2, 3]
      workflow: wf_work var="<% $.i + $.j %>"
      publish:
        res: <% $.invoke_wf %>
2. Execute "mistral workflow-create <def.yaml>"
3. Try to execute this workflow

Observed result:
unsupported operand type(s) for +: 'int' and 'NoneType'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
    executor_callback))
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
    executor_callback)
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
    result = func(ctxt, **new_args)
  File "/home/ubuntu/mistral/mistral/engine/rpc.py", line 96, in start_workflow
    **params
  File "/home/ubuntu/mistral/mistral/utils/__init__.py", line 104, in _logged
    return func(*args, **kw)
  File "/home/ubuntu/mistral/mistral/engine/default_engine.py", line 87, in start_workflow
    raise e
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

Expected result:
User friendly error: "Variable 'foo' was undefined"

Changed in mistral:
milestone: kilo-rc2 → none
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/180953
Committed: https://git.openstack.org/cgit/stackforge/mistral/commit/?id=d55ed99b5051a1e076336780e386a4eb23c56eeb
Submitter: Jenkins
Branch: master

commit d55ed99b5051a1e076336780e386a4eb23c56eeb
Author: Nikolay Mahotkin <email address hidden>
Date: Thu May 7 14:42:33 2015 +0300

    Fixing YAQL related errors

     * Now Mistral raises YaqlEvaluationException if
       something was wrong with evaluating YAQL.

    Closes-Bug: #1449505

    Change-Id: Ic6a1592b8424ebdbaaca698b9a894d589def97d2

Changed in mistral:
status: In Progress → Fix Committed
Changed in mistral:
milestone: 1.0.0 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.