Add validation for conflicting merge strategies

Bug #1644217 reported by Rabi Mishra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Rabi Mishra

Bug Description

If you don't specify merge_strategy(defaults to overwrite) for a parameter in one of the environment files, then it would overwrite the merged value for the parameter in the environment files before.

[stack@f24-devstack ~]$ cat env1.yaml
parameters:
  services:
    - nova
    - cinder

[stack@f24-devstack ~]$ cat env2.yaml
parameters:
  services:
    - neutron
parameter_merge_strategies:
  services: merge

[stack@f24-devstack ~]$ cat env3.yaml
parameters:
  services:
    - mistral

[stack@f24-devstack ~]$ cat env4.yaml
parameters:
  services:
    - zaqar
parameter_merge_strategies:
  services: merge

[stack@f24-devstack ~]$ cat env_merge.yaml
heat_template_version: ocata
parameters:
  services:
    type: comma_delimited_list

outputs:
  service_list:
    value: {get_param: services}

[stack@f24-devstack ~]$ heat stack-create test_stack -f env_merge.yaml -e env1.yaml -e env2.yaml -e env3.yaml -e env4.yaml

[stack@f24-devstack ~]$ heat output-show test_stack service_list
WARNING (shell) "heat output-show" is deprecated, please use "openstack stack output show" instead
[
  "mistral",
  "zaqar"
]

env3.yaml value for 'services' overwrites value from the earlier env files(env1.yaml and env2.yaml). Though this is an an expected behaviour(merge staregies are scoped to the env file and default strategy is 'overwrite', it would be good to catch that there is a conflicting merge strategy(default) for 'services' in env3.yaml.

Rabi Mishra (rabi)
Changed in heat:
milestone: none → ocata-2
Rabi Mishra (rabi)
Changed in heat:
assignee: nobody → Rabi Mishra (rabi)
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/402335

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/402335
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=1b05208fd48c99e975d50db6cf97baacb81182af
Submitter: Jenkins
Branch: master

commit 1b05208fd48c99e975d50db6cf97baacb81182af
Author: rabi <email address hidden>
Date: Fri Nov 25 12:05:18 2016 +0530

    Add validation for conflicting merge strategies

    It would raise an error if conflicting merge strategies
    are specified for a paramater or parameter_default in
    environment files.

    Change-Id: I9f7b15cde73b370a0cdd71a94e9f88e804cb3819
    Closes-Bug: #1644217

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 8.0.0.0b2

This issue was fixed in the openstack/heat 8.0.0.0b2 development milestone.

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.