template-validate returns value not default

Bug #1497310 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Steven Hardy

Bug Description

The template-validate code returns a "Default" key, which is supposed to contain the default defined for a parameter.

Historically, we only supported reading a template, no parameters/environment but a while ago we added support to pass an environment (which may contain parameter values) via bug #1298450

This means that (with the current implementation), if you pass a parameter value in the environment, it gets returned instead of the actual default via the "Default" key in the template-validate parameters output.

We should always return the actual parameter default, but it's probably useful to also expose the parsed value of the user-provided value too, so we should probably add a "Value" key to supplement the "Default" that is already returned, then both values will always be visible (if passed).

This will also be useful to determine at validation time if a given environment contains all parameter values required for a given template, or if additional mandatory parameters must be specified for a stack-create to succeed.

Steven Hardy (shardy)
Changed in heat:
assignee: nobody → Steven Hardy (shardy)
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/225184

Changed in heat:
status: New → In Progress
Changed in heat:
importance: Undecided → Medium
milestone: none → liberty-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/225184
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=4ddd4cb2bd6ec723d5d2137c85114a323d42a897
Submitter: Jenkins
Branch: master

commit 4ddd4cb2bd6ec723d5d2137c85114a323d42a897
Author: Steven Hardy <email address hidden>
Date: Fri Sep 18 15:49:12 2015 +0100

    Always return default via template-validate "Default"

    Currently we redefine the value of Default when a user value is
    provided, which means the data returned doesn't match the schema
    defined in the template. Instead always return the actual default
    and add a "Value" key that contains the user value, if provided.

    Change-Id: If4ed0b733d4e61c84167063c36cdcb234b001136
    Closes-Bug: #1497310

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