resource creation failes with type error if derived from a parameter

Bug #1397969 reported by Removed by request
6
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Peter Razumovsky

Bug Description

I have a testing environment with several interchangeable and modular templates.
The 'parent' template calls other templates by using resource type: template.yaml.
I would like to be able to use different templates with the same parent for different test scenarios and so I have tried to do this:

parameters:
  networking:
    type: string
    default: simple.yaml
  server:
  .
  .
  .
  etc'

resources:
  network:
    type: {get_param: networking} <-- sometimes I'd like to use a different yaml without having to change the template manually...

This is probably not working, but the error in this case is misleading:
# heat stack-show test
.
.
.

| stack_status_reason | Resource CREATE failed: TypeError: Resource volume type
| | typemust be string

If this should not work on the first place, then this is a validation issue that should be caught earlier on.

Tested on 0.2.12

Revision history for this message
Steven Hardy (shardy) wrote :

> type: {get_param: networking}

This is not expected to work, you should use the environment resource_registry instead.

We should fail fast though, at validation rather than create time.

Changed in heat:
status: New → Triaged
importance: Undecided → Medium
Changed in heat:
assignee: nobody → Sergey Kraynev (skraynev)
Changed in heat:
assignee: Sergey Kraynev (skraynev) → nobody
assignee: nobody → Razumovsky Peter (prazumovsky)
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/140976

Changed in heat:
status: Triaged → In Progress
Revision history for this message
Peter Razumovsky (prazumovsky) wrote :

Amit Ugol, I can't reproduce this bug on 0.2.12 and think, that https://review.openstack.org/#/c/134343/ fixes your problem. Can you try to reproduce your problem with this patch?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/140976
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=3f16eebd06bc964975b47496a6a1ef844986edfa
Submitter: Jenkins
Branch: master

commit 3f16eebd06bc964975b47496a6a1ef844986edfa
Author: Peter Razumovsky <email address hidden>
Date: Wed Dec 10 17:30:15 2014 +0300

    Add resource_definitions check to Stack.validate

    We should check resource attributes' types in validate method
    for preventing stack creation with incorrect resources. So
    this patch splits resource_definitions() methods on
    validate_resource_definitions() and resource_definitions()
    methods and add validate_resource_definitions() to Stack.validate
    method.

    Change-Id: I16b35fc105154d9391f64285e90c396537fe3bb7
    Partial-bug: #1397969

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-1 → 5.0.0
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.