path based attributes/parameters aren't correctly validated

Bug #1681749 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Triaged
Medium
Unassigned

Bug Description

I noticed that invalid references to json parameters are allowed via path based parameters/attributes:

heat_template_version: ocata

parameters:
  RoleData:
     type: json
     default:
       step1: foo
       step3: foo

resources:

  value:
    type: OS::Heat::Value
    properties:
      value:
        step1: {get_param: [RoleData, step1]}
        step2: {get_param: [RoleData, step2]}
        step3: {get_param: [RoleData, step3]}
        step4: {get_param: [RoleData, step4]}
        anything: {get_param: [RoleData, noexist]}

This works, and creates a resource like:

| attributes | { |
| | "value": { |
| | "anything": "", |
| | "step4": "", |
| | "step3": "foo", |
| | "step2": "", |
| | "step1": "foo" |
| | } |
| | } |

We probably can't fix this without a template version bump, as I know some templates (I found this in the tripleo templates, which currently rely on this behavior...) may break if we fix it.

But I wanted to raise the issue as I think this is probably wrong and we should probably consider more correct validation in future.

Rico Lin (rico-lin)
Changed in heat:
status: New → Triaged
importance: Undecided → Medium
milestone: none → ongoing
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.