action under with-items doesn't take non-array parameters

Bug #1426258 reported by Dmitri Zimine
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
High
Nikolay Makhotkin

Bug Description

https://blueprints.launchpad.net/mistral/+spec/mistral-with-items-multi-inputs - I'll remove the blueprint, it's a BUG.

Filing for Winson:

Currently, if an action has multiple inputs, all the inputs need to be in the with-items array. There are cases where the action inputs can come from a previous published variables or WF inputs and they are not in an array.

Example:
with-items: name in vm_names
action: do_something n=<% name %> foo=<% my_published_var %>

Revision history for this message
Nikolay Makhotkin (nmakhotkin) wrote :

Please take a look at this test: https://github.com/stackforge/mistral/blob/master/mistral/tests/unit/engine1/test_with_items.py#L55-L75
here: https://github.com/stackforge/mistral/blob/master/mistral/tests/unit/engine1/test_with_items.py#L175-L201

It means that with-items should work fine with all data_context.

Moreover, I tried to test it manually:

1. Created workbook

version: "2.0"
name: wi
workflows:
  with_items:
    type: direct
    input:
     - queries
     - method
    tasks:
      task1:
        with-items: q in <% $.queries %>
        action: std.http method=<% $.method %> url="http://google.com?q=<% $.q %>!"
        publish:
          result: <% $.task1 %>

2. It works fine with input, e.g.: mistral execution-create wi.with_items '{"method": "GET", "queries": ["Alaska", "Mistral", "OpenStack"]}'

3. task task1 'SUCCESS': | task-id | task1 | wi.with_items | exec_id | SUCCESS |
4. Result contains 3 entities.

Changed in mistral:
status: New → Incomplete
Changed in mistral:
status: Incomplete → Fix Released
Changed in mistral:
milestone: none → kilo-rc1
Changed in mistral:
milestone: kilo-rc1 → 2015.1
assignee: nobody → Nikolay Makhotkin (nmakhotkin)
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.