Keep dynamic network creation backward compatible.

We had an history mapping for InternalApi to InternalNetwork.  If we
remove it then heat will want to destroy InternalNetwork and create
InternalApi which cannot work during upgrade.

This adds compat name parameters to network_data.yaml.

Closes-Bug: #1709105

Change-Id: I8ce6419a5e13a13ee6e991db5ca2196763f52d7a
This commit is contained in:
Sofer Athlan-Guyot 2017-08-07 16:04:08 +02:00
parent 5bf7d6582b
commit a8a1d5b30c
2 changed files with 7 additions and 3 deletions

View File

@ -3,9 +3,9 @@ heat_template_version: pike
description: Create networks to split out Overcloud traffic description: Create networks to split out Overcloud traffic
resources: resources:
{%- for network in networks %} {%- for network in networks %}
{{network.name}}Network: {%- set network_name = network.compat_name|default(network.name) %}
{{network_name}}Network:
type: OS::TripleO::Network::{{network.name}} type: OS::TripleO::Network::{{network.name}}
{%- endfor %} {%- endfor %}
@ -19,8 +19,9 @@ outputs:
# NOTE(gfidente): we need to replace the null value with a # NOTE(gfidente): we need to replace the null value with a
# string to work around https://bugs.launchpad.net/heat/+bug/1700025 # string to work around https://bugs.launchpad.net/heat/+bug/1700025
{%- for network in networks %} {%- for network in networks %}
{%- set network_name = network.compat_name|default(network.name) %}
{{network.name_lower}}: {{network.name_lower}}:
yaql: yaql:
data: {get_attr: [{{network.name}}Network, subnet_cidr]} data: {get_attr: [{{network_name}}Network, subnet_cidr]}
expression: str($.data).replace('null', 'disabled') expression: str($.data).replace('null', 'disabled')
{%- endfor %} {%- endfor %}

View File

@ -17,6 +17,8 @@
# allocation_pools: IP range list e.g. [{'start':'10.0.0.4', 'end':'10.0.0.250}] # allocation_pools: IP range list e.g. [{'start':'10.0.0.4', 'end':'10.0.0.250}]
# gateway_ip: gateway for the network (optional, may use parameter defaults) # gateway_ip: gateway for the network (optional, may use parameter defaults)
# NOTE: IP-related values set parameter defaults in templates, may be overridden. # NOTE: IP-related values set parameter defaults in templates, may be overridden.
# compat_name: for existing stack you may need to override the default transformation
# for the resource's name.
# #
# Example: # Example:
# - name Example # - name Example
@ -39,6 +41,7 @@
vip: true vip: true
ip_subnet: '172.16.2.0/24' ip_subnet: '172.16.2.0/24'
allocation_pools: [{'start': '172.16.2.4', 'end': '172.16.2.250'}] allocation_pools: [{'start': '172.16.2.4', 'end': '172.16.2.250'}]
compat_name: Internal
- name: Storage - name: Storage
vip: true vip: true
name_lower: storage name_lower: storage