with-items does not work with actions with action_context

Bug #1416923 reported by Winson Chan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
High
Nikolay Makhotkin

Bug Description

~/tmp$ cat test-repeat.yaml
---
version: "2.0"
wf1_with_items:
  type: direct
  input:
    - links
  tasks:
    task1:
      with-items: link in $.links
      action: std.mistral_http url={$.link}
      publish:
        result: $

~/tmp$ mistral workflow-create test-repeat.yaml
Starting new HTTP connection (1): localhost
+----------------+--------+-------+----------------------------+------------+
| Name | Tags | Input | Created at | Updated at |
+----------------+--------+-------+----------------------------+------------+
| wf1_with_items | <none> | links | 2015-02-02 01:08:14.986971 | None |
+----------------+--------+-------+----------------------------+------------+

~/tmp$ mistral execution-create wf1_with_items '{"links": ["https://raw.githubusercontent.com/stackforge/mistral/master/requirements.txt"]}'
Starting new HTTP connection (1): localhost
Remote error: InputException Wrong input format for: {'action_context': {'workflow_name': u'wf1_with_items', 'task_tags': None, 'task_id': u'82ce5e13-d0ec-44d4-9c30-e928655b9c93', 'execution_id': u'2c6ab75b-ef3a-4fa1-bedd-507e1ab4e85a', 'task_name': u'task1'}, u'link': [u'https://raw.githubusercontent.com/stackforge/mistral/master/requirements.txt']}. List type is expected for each value.
[u'Traceback (most recent call last):\n', u' File "/opt/openstack/mistral/.venv/local/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 137, in _dispatch_and_reply\n incoming.message))\n', u' File "/opt/openstack/mistral/.venv/local/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 180, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n', u' File "/opt/openstack/mistral/.venv/local/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 126, in _do_dispatch\n result = getattr(endpoint, method)(ctxt, **new_args)\n', u' File "/home/vagrant/code/openstack/mistral/mistral/engine1/rpc.py", line 81, in start_workflow\n **params\n', u' File "/home/vagrant/code/openstack/mistral/mistral/utils/__init__.py", line 94, in _logged\n return func(*args, **kw)\n', u' File "/home/vagrant/code/openstack/mistral/mistral/engine1/default_engine.py", line 76, in start_workflow\n self._run_remote_commands(cmds, exec_db, wf_handler)\n', u' File "/home/vagrant/code/openstack/mistral/mistral/engine1/default_engine.py", line 180, in _run_remote_commands\n if not cmd.run_remote(exec_db, wf_handler, cause_task_db):\n', u' File "/home/vagrant/code/openstack/mistral/mistral/engine1/commands.py", line 147, in run_remote\n self._run_task()\n', u' File "/home/vagrant/code/openstack/mistral/mistral/engine1/commands.py", line 162, in _run_task\n self._run_action()\n', u' File "/home/vagrant/code/openstack/mistral/mistral/engine1/commands.py", line 228, in _run_action\n action_input_collection = with_items.calc_input(action_input)\n', u' File "/home/vagrant/code/openstack/mistral/mistral/workflow/with_items.py", line 170, in calc_input\n validate_input(with_items_input)\n', u' File "/home/vagrant/code/openstack/mistral/mistral/workflow/with_items.py", line 193, in validate_input\n " expected for each value." % with_items_input\n', u"InputException: Wrong input format for: {'action_context': {'workflow_name': u'wf1_with_items', 'task_tags': None, 'task_id': u'82ce5e13-d0ec-44d4-9c30-e928655b9c93', 'execution_id': u'2c6ab75b-ef3a-4fa1-bedd-507e1ab4e85a', 'task_name': u'task1'}, u'link': [u'https://raw.githubusercontent.com/stackforge/mistral/master/requirements.txt']}. List type is expected for each value.\n"].

Dmitri Zimine (i-dz)
Changed in mistral:
importance: Undecided → High
milestone: none → kilo-2
status: New → Confirmed
Changed in mistral:
assignee: nobody → Nikolay Makhotkin (nmakhotkin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

Fix proposed to branch: master
Review: https://review.openstack.org/152139

Changed in mistral:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

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

commit 115d6362a717475b473573022d9808a10a91147a
Author: Nikolay Mahotkin <email address hidden>
Date: Mon Feb 2 17:49:13 2015 +0300

    Fix action_context in with_items

    Closes-Bug: #1416923

    Change-Id: Ie2cc72778e914e48cd54019e4f0bbbd0a8bf7d21

Changed in mistral:
status: In Progress → Fix Committed
Changed in mistral:
status: Fix Committed → Fix Released
Changed in mistral:
milestone: kilo-2 → 2015.1
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.