ResourceGroup attributes references not validated

Bug #1464628 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Confirmed
Undecided
kumari paluru

Bug Description

When using the "attributes" interface of ResourceGroup, no validation of the attributes schema (or outputs in the case of a nested stack) is performed, so we fail slow in the event that there's an error in the template.

For example:

heat_template_version: 2014-10-16
resources:
  Controller:
    type: OS::Heat::ResourceGroup
    properties:
      count: 1
      resource_def:
        type: OS::Heat::RandomString

  ANested:
    type: nested.yaml
    properties:
      random_values: {get_attr: [Controller, attributes, valuex]}

Where nested.yaml is (dummy empty template just for the reproducer):

heat_template_version: 2014-10-16
parameters:
  random_values:
    type: json

The typo "valuex" isn't caught during validation, so the stack create starts and we go to CREATE_FAILED, not a big deal in this case, but I discovered this working on TripleO templates where such a fail-slow situation is much less convenient :)

Rico Lin (rico-lin)
Changed in heat:
assignee: nobody → Rico Lin (rico-lin)
Rico Lin (rico-lin)
Changed in heat:
status: New → Confirmed
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

This may be hard to fix since some resources have a dynamic attributes schema (such as deployment resources, where arbitrary outputs become attributes). There is a danger of over-validating templates which used to work just fine.

Rico Lin (rico-lin)
Changed in heat:
assignee: Rico Lin (rico-lin) → nobody
Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
Revision history for this message
kumari paluru (kumari-paluru) wrote :

Hi..
 I tried with the template. It is working fine.
heat_template_version: 2014-10-16
resources:
  Controller:
    type: OS::Heat::ResourceGroup
    properties:
      count: 1
      resource_def:
        type: OS::Heat::RandomString

  ANested:
    type: nested.yaml
    properties:
      random_values: {get_attr: [Controller, value]}

Changed in heat:
assignee: nobody → kumari paluru (kumari-paluru)
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.