Querying "attributes" of ResourceGroup hints misleadingly

Bug #1483168 reported by Yingzhe Zeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Kairat Kushaev

Bug Description

1. Create a stack with following template:
-----------------------------------------------------------------------------
heat_template_version: 2015-04-30
description: create cinder volume

resources:
    res-group:
        type: OS::Heat::ResourceGroup
        properties:
            count: 3
            resource_def:
                type: OS::Cinder::Volume
                properties:
                    name: volres_%index%
                    size: 1

outputs:
    attrs-outputs:
        value: { get_attr: [res-group, attributes] }
-----------------------------------------------------------------------------

2. Use "output-show" command to query outputs of this stack, as shown:
-----------------------------------------------------------------------------
  {
    "output_value": null,
    "output_error": "The Referenced Attribute (res-group attributes) is incorrect.",
    "description": "No description given",
    "output_key": "attrs-outputs"
  }
-----------------------------------------------------------------------------

3. The "output_error" message is "The Referenced Attribute (res-group attributes) is incorrect.", which is kind of misleading,
   because "attributes" is a valid attribute of ResourceGroup resource.

4. The real reason is that should configure the querying attribute of child resources of ResourceGroup, but the example above doesn't.

5. The code related to this problem is in FnGetAtt of ResourceGroup, as shown:
-----------------------------------------------------------------------------
if key == self.ATTR_ATTRIBUTES:
 if not path:
  raise exception.InvalidTemplateAttribute(
   resource=self.name, key=key)
-----------------------------------------------------------------------------

Change the raised exception here to hint users correctly, perhaps something like ChildResourceAttrNotSpecify.

Changed in heat:
assignee: nobody → Kairat Kushaev (kkushaev)
Changed in heat:
status: New → In Progress
Revision history for this message
Kairat Kushaev (kkushaev) wrote :

So I added the fix that introduces such kind of exception as subtype of Invalid TemplateAttribute:
https://review.openstack.org/#/c/209544/

Revision history for this message
Yingzhe Zeng (zengyingzhe) wrote :

Yes, it's already fixed. Very great.
Thanks Kushaev.

Changed in heat:
importance: Undecided → Medium
milestone: none → liberty-3
Changed in heat:
status: In Progress → Fix Committed
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-3 → 5.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (master)

Change abandoned by Kairat Kushaev (<email address hidden>) on branch: master
Review: https://review.openstack.org/209544
Reason: Sorry, I don't have enough time to work on this in Mitaka.
So feel free to pick up the work.

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.