Heat constrants validate the default parameter value instead of the one passed

Bug #1394100 reported by JunJie Nan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Peter Razumovsky

Bug Description

Heat constrants validate the default parameter value instead of the one passed. For example:
  image:
    type: string
    default: cirros
    constraints:
      - custom_constraint: glance.image
        description: Must identify an image known to Glance

When run heat stack-create -f ... -P image=fedora, if there is no cirros image in glance, valiation error will be raised to say no the cirros image found, although I have provided the existing one fedora.

Qi Zhang (qizh)
Changed in heat-templates:
status: New → Incomplete
no longer affects: heat-templates
Changed in heat:
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/141043

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/141043
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=7d09bc1c1228f2b5382fda15ca243fa80d2e97de
Submitter: Jenkins
Branch: master

commit 7d09bc1c1228f2b5382fda15ca243fa80d2e97de
Author: Peter Razumovsky <email address hidden>
Date: Thu Dec 11 15:58:08 2014 +0300

    Don't validate custom constraints on default values

    When user provides it's own parameter's value, there is no
    reason to check custom constraint on default value of this
    parameter. And if there is no user value, default value
    validates anyway. So custom_constraint validation of default
    values is unnecessary.

    Change-Id: Ied3feefc7d062ddb20d42cfc5b2c30be4fdc3227
    Closes-bug: #1394100

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