Querying "attributes" of ResourceGroup hints misleadingly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
Medium
|
Kairat Kushaev |
Bug Description
1. Create a stack with following template:
-------
heat_template_
description: create cinder volume
resources:
res-group:
type: OS::Heat:
properties:
count: 3
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_
if not path:
raise exception.
resource=
-------
Change the raised exception here to hint users correctly, perhaps something like ChildResourceAt
Changed in heat: | |
assignee: | nobody → Kairat Kushaev (kkushaev) |
Changed in heat: | |
status: | New → In Progress |
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 |
Changed in heat: | |
milestone: | liberty-3 → 5.0.0 |
So I added the fix that introduces such kind of exception as subtype of Invalid TemplateAttribute: /review. openstack. org/#/c/ 209544/
https:/