When I launch a heat template with constraints custom_constraint and allowed_values on one parameter it fails

Bug #1521038 reported by Martin Paulo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
heat-dashboard
Confirmed
Medium
Lin Hua Cheng

Bug Description

We have just upgraded from Juno to Liberty.

A heat template (that used to work in Juno) declares the following parameter:
  instance_type:
    type: string
    description: The flavour the webserver is to run on
    default: m2.xsmall
    constraints:
      - allowed_values: [m2.xsmall, m2.small, m1.small]
        description:
          Must be a valid flavour, limited to the smaller ones available
      - custom_constraint: nova.flavor

When I try to load it via the dashboard, the drop down for the parameter no longer shows the allowed values, instead now listing all of the possible values. And when I select a value and launch the stack, I get the error message:
Error: ERROR: Parameter 'instance_type' is invalid: Must be a valid NeCTAR flavour, limited to the smaller ones available
And the stack fails to launch.

However, it launches quite happily from the command line.

If I comment either of the constraints out, the template works in the dashboard.

If I comment out the allowed_values constraint, I get a list of the flavors that I can select. So I'm guessing that you have written some helpful code to list the available flavors if I constrain it to nova.flavors: and that this is clashing with the allowed_values somehow...

Tags: heat
Sam Morrison (sorrison)
description: updated
tags: added: heat
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

Looking at the code, it seems that the two option can't be used at the same time: https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/stacks/forms.py#L327-L336

If custom constraint is used, the allowedvalues is not applied anymore.

The change was introduced here: https://review.openstack.org/#/c/133270/

I suppose the expected behavior is:
1. Apply the custom constraint to get the list of Values
2. then if AllowedValues is defined, filter the list returned.

Changed in horizon:
status: New → Confirmed
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
importance: Undecided → Medium
Revision history for this message
Akihiro Motoki (amotoki) wrote :

heat panel is split out to heat-dashboard. Retargeting to heat-dashboard.

affects: horizon → heat-dashboard
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.