Wrong action_execution output evaluation using with-items

Bug #1706893 reported by Nikolay Makhotkin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mistral
Invalid
Medium
Renat Akhmerov

Bug Description

consider task the following:

get_volumes:
      with-items: id in <% $.volume_ids %>
      action: cinder.volumes_list
      input:
        search_opts: <% {"id" => $.id} + $.search_opts %>
      publish:
        volumes: <% task(get_volumes).result.where(len($) > 0).select({id => $[0].id, status => $[0].status}) %>
      on-success:
        - delete_all_volumes

$.volume_ids consist of 2 UUIDs, i.e == ["id1", "id2"]

Action execution objects: http://paste.openstack.org/show/616679/

But there are somehow merged outputs in each action execution: each one contains more than one volume. So I expected the following published variable in task:

[
  {
    "id": "id1",
    "status": "status1"
  },
  {
    "id": "id2",
    "status": "status2"
  }
]

But I got

[
  {
    "id": "id1",
    "status": "status1"
  },
  {
    "id": "id1",
    "status": "status1"
  }
]

Pay attention to id1/id2. Due to each action execution contains the same output (for 2 volumes) - I get only the first one for each and eventually they are the same.

UPD: The issue is related to YAQL. Somehow the expression <% {"id" => $.id + $.search_opts} %> where variable $.search_opts == {} resulted in {} (!!!) but should be {"id": $.id}. So volume list returned the whole volume list and therefore each action execution contains 2 volumes instead 1.

Changed in mistral:
milestone: none → pike-3
assignee: nobody → Renat Akhmerov (rakhmerov)
importance: Undecided → Critical
importance: Critical → High
importance: High → Critical
Revision history for this message
Renat Akhmerov (rakhmerov) wrote :

As I understand there's no issue in Mistral. It may be in YAQL. Nikolay, can you please add what you discovered?

Changed in mistral:
status: New → Incomplete
description: updated
Changed in mistral:
status: Incomplete → New
importance: Critical → Medium
Changed in mistral:
milestone: pike-3 → pike-rc1
Revision history for this message
Nikolay Makhotkin (nmakhotkin) wrote :

I investigated the problem and it seems that cinder.volumes_list doesn't process "id" search opt. And eventually I always get the whole volume list.

Changed in mistral:
status: New → Invalid
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.