Launch Stack doesn't apply parameters from environment file

Bug #1388985 reported by Doug Fish
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Undecided
Doug Fish
OpenStack Heat
Fix Released
Medium
Doug Fish
Icehouse
Fix Released
Medium
Ethan Lynn
Juno
Fix Released
Medium
Ethan Lynn

Bug Description

I'm using an environment file to pass a parameter into a simple heat template and the parameter is not relfected in the Horizon UI nor the created resource.

To recreate:
Project->Orchestration->Stacks->Launch Stack
Provde the template.txt and env.txt files I've attached. I used the "File" source option.
Click next.
I'd expect to see the net_name as "betternetname" from the env file, but instead "defaultnet" is displayed.

Continuing to launch, the network is named "defaultnet".

Revision history for this message
Doug Fish (drfish) wrote :
Revision history for this message
Doug Fish (drfish) wrote :
Revision history for this message
Doug Fish (drfish) wrote :

Reading more closely, maybe I've misunderstood the relationship. Is the template file supposed to be the top priority?

Revision history for this message
Doug Fish (drfish) wrote :

Actually I see the behavior of
heat stack-create -f template.txt -e env.txt test
is that the environment file parameters overrides the template file and the network is named "bettername".

Horizon should work the same way.

Doug Fish (drfish)
Changed in horizon:
assignee: nobody → Doug Fish (drfish)
Revision history for this message
Doug Fish (drfish) wrote :

The UI is relying on a call to heat to parse and validate the template file
https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/stacks/forms.py#L147

which maps through some additonal UI abstraction and python-heatclient to be the same call as
heat template-validate -f template.txt -e env.txt

which returns
{
  "Description": "create a network",
  "Parameters": {
    "net_name": {
      "Default": "defaultnet",
      "Type": "String",
      "NoEcho": "false",
      "Description": "Name of private network to be created",
      "Label": "net_name"
    }
  }
}

This seems like a bug in Heat to me. The -e parameter is ignored when validating the template.

Thoughts from the heat team?

affects: horizon → heat-templates
affects: heat-templates → horizon
Revision history for this message
Qiming Teng (tengqim) wrote :

This doesn't look like a bug to me, because the 'net_name' parameter in your template overrides the 'net_name' parameter you specified in the environment file.

Revision history for this message
Doug Fish (drfish) wrote :

Qiming thanks for taking a look at this. To be clear this is the command that I suspect has a bug
heat template-validate -f template.txt -e env.txt

which returns
{
  "Description": "create a network",
  "Parameters": {
    "net_name": {
      "Default": "defaultnet",
      "Type": "String",
      "NoEcho": "false",
      "Description": "Name of private network to be created",
      "Label": "net_name"
    }
  }
}

and my 'net_name' parameter has not been overridden the value in the environment file.

Doug Fish (drfish)
Changed in heat:
assignee: nobody → Doug Fish (drfish)
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/134080

Changed in heat:
status: New → In Progress
Doug Fish (drfish)
Changed in horizon:
status: New → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/136249

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

Reviewed: https://review.openstack.org/134080
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=09bc7ad79e4d95cffd8db19c781dc66230640d84
Submitter: Jenkins
Branch: master

commit 09bc7ad79e4d95cffd8db19c781dc66230640d84
Author: Doug Fish <email address hidden>
Date: Wed Nov 12 17:29:40 2014 -0600

    Use environment file in template-validate

    Use the -e parameter in template-validate to override any
    Default values specified in the template. This has the desirable
    effect of making Horizon use parameters updated from the environment
    file.

    Change-Id: I84405d1d2f5245ab7cb8b909c2ea1407d5b2973e
    Closes-Bug: #1388985

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/136413

Alan Pevec (apevec)
Changed in heat:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/juno)

Reviewed: https://review.openstack.org/136249
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=dc1b99d064d9fbb6439357e89c770f15810f7cce
Submitter: Jenkins
Branch: stable/juno

commit dc1b99d064d9fbb6439357e89c770f15810f7cce
Author: Doug Fish <email address hidden>
Date: Wed Nov 12 17:29:40 2014 -0600

    Use environment file in template-validate

    Use the -e parameter in template-validate to override any
    Default values specified in the template. This has the desirable
    effect of making Horizon use parameters updated from the environment
    file.

    Change-Id: I84405d1d2f5245ab7cb8b909c2ea1407d5b2973e
    Closes-Bug: #1388985
    (cherry picked from commit 09bc7ad79e4d95cffd8db19c781dc66230640d84)

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

Reviewed: https://review.openstack.org/136413
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=5a34e4fa1289cc49143739259c452f9e4829d95b
Submitter: Jenkins
Branch: stable/icehouse

commit 5a34e4fa1289cc49143739259c452f9e4829d95b
Author: Doug Fish <email address hidden>
Date: Wed Nov 12 17:29:40 2014 -0600

    Use environment file in template-validate

    Use the -e parameter in template-validate to override any
    Default values specified in the template. This has the desirable
    effect of making Horizon use parameters updated from the environment
    file.

    Conflicts:
     heat/engine/service.py
     heat/tests/test_validate.py

    Change-Id: I84405d1d2f5245ab7cb8b909c2ea1407d5b2973e
    Closes-Bug: #1388985
    (cherry picked from commit 09bc7ad79e4d95cffd8db19c781dc66230640d84)
    (cherry picked from commit dc1b99d064d9fbb6439357e89c770f15810f7cce)

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