template-validate fails when using parameters with custom_constraint and default
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
High
|
Thomas Spatzier | ||
Icehouse |
Fix Released
|
High
|
Thomas Spatzier |
Bug Description
When using a template with parameters than have both a custom_constraint (e.g. nova.flavor) and a default value, both template-validate and stack-create fail with an exception.
A first look into the code revealed that the rpc context is None in the place where validation of the custom constraint is done (and therefore openstack clients are being used). Seems like the rpc context is not properly propagated in that path.
Steps to reproduce:
Use the template below and then just try a 'heat stack-create' or 'heat template-validate'.
Template:
#######
heat_template_
description: Just a simple test template.
parameters:
key_name:
type: string
description: Name of an existing key pair to use for the instance.
default: heat_key
flavor:
type: string
description: Flavor for the server to be created.
default: m1.tiny
constraints:
- custom_constraint: nova.flavor
image:
type: string
description: The image to use for the server.
resources:
my_server:
type: OS::Nova::Server
properties:
key_name: { get_param: key_name }
image: { get_param: image }
flavor: { get_param: flavor }
outputs:
server_ip:
description: The IP address of the deployed server.
value: { get_attr: [my_server, networks, private, 0] }
Changed in heat: | |
assignee: | nobody → Thomas Spatzier (thomas-spatzier) |
Changed in heat: | |
status: | New → In Progress |
Changed in heat: | |
importance: | Undecided → High |
tags: | added: icehouse-backport-potential |
Changed in heat: | |
milestone: | none → juno-1 |
status: | Fix Committed → Fix Released |
Changed in heat: | |
milestone: | juno-1 → 2014.2 |
Fix proposed to branch: master /review. openstack. org/91485
Review: https:/