refs attribute of ResourceGroup does not support indexing

Bug #1434586 reported by Pavlo Shchelokovskyy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Low
Ishant Tyagi

Bug Description

minimal reproducer:

$ cat refs.yaml
heat_template_version: 2015-04-30
resources:
  group:
    type: OS::Heat::ResourceGroup
    properties:
      count: 2
      resource_def:
        type: OS::Heat::RandomString
outputs:
  allrefs:
    value: { get_attr: [ group, refs ] }
  oneref:
    value: { get_attr: [group, refs, 0 ] }

$ heat stack-create refs -f refs.yaml
$ heat stack-list
+--------------------------------------+------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+-----------------+----------------------+
| 5a7dec43-ebe8-46e5-a1e0-46871bd67da4 | refs | CREATE_COMPLETE | 2015-03-20T14:07:31Z |
+--------------------------------------+------------+-----------------+----------------------+

$ heat output-show refs allrefs
[
  "a4t2y5IuYLJzEZRVdFCEKhAnaWfI9vTi",
  "5HwxHxZN41J78l42OKH07igJif8Pk7tn"
]

$ heat output-show refs oneref
[
  "a4t2y5IuYLJzEZRVdFCEKhAnaWfI9vTi",
  "5HwxHxZN41J78l42OKH07igJif8Pk7tn"
]

Changed in heat:
assignee: nobody → Ishant Tyagi (ishant-tyagi)
Angus Salkeld (asalkeld)
Changed in heat:
status: New → Triaged
importance: Undecided → Low
milestone: none → next
tags: added: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

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

Reviewed: https://review.openstack.org/168301
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=553727cfd017c7a01c8eaa24a43c807ad2202855
Submitter: Jenkins
Branch: master

commit 553727cfd017c7a01c8eaa24a43c807ad2202855
Author: tyagi <email address hidden>
Date: Fri Mar 27 04:11:50 2015 -0700

    Make 'refs' attribute of ResourceGroup resource indexable

    With this change 'refs' attribute of the ResourceGroup resource will
    support indexing.

    Change-Id: I7715897091a55ed333e4b07bd1ad38bd4d8aa019
    Closes-Bug: #1434586

Changed in heat:
status: In Progress → Fix Committed
Angus Salkeld (asalkeld)
Changed in heat:
milestone: next → kilo-rc1
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-rc1 → 2015.1.0
Revision history for this message
Jeffrey Guan (double12gzh) wrote :

I tested this on heat_template_version: '2014-10-16' and found that this fixed is not included.

I am wondering if there is any workaround for this issus on heat_template_version: '2014-10-16'?

Thank you very much.

Revision history for this message
Rabi Mishra (rabi) wrote :

I think you want this work with Juno. However, Juno is EOL[1], hence this can't be back-ported.

[1] http://docs.openstack.org/releases/

Revision history for this message
Jeffrey Guan (double12gzh) wrote :

Yes, I want to use Juno. Thank you very much for your valuable info.

I will find a workaround for this on Juno.

Thank you very much.

Revision history for this message
carl (gsl0610) wrote :

We can update the code in heat with the fix under heat/engine/resources/openstack/heat/resource_group.py.
https://review.openstack.org/168301

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.