Allow only vxlan networks to be created in Neutron.

If network_mappings is defined but empty, we should treat it as though
it is undefined. Otherwise the template tasks will fail due to there
being no "network_mappings[0]".

We should add a test case for this once the fix is backported to the
stable/ocata branch, to avoid a regression in future. Currently this
would fail the upgrade gate due to this bug coming up in stable/ocata
branch.

Change-Id: Ifd0d2c23bb65225d27c74360ff521b84676b7a81
Closes-Bug: #1528307
This commit is contained in:
Andy McCrae 2017-07-26 14:35:17 +01:00
parent b25a6fb29e
commit 46a22cccac
3 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ agent_down_time = {{ neutron_agent_down_time }}
l3_ha = True l3_ha = True
l3_ha_net_cidr = {{ neutron_l3_ha_net_cidr }} l3_ha_net_cidr = {{ neutron_l3_ha_net_cidr }}
max_l3_agents_per_router = {{ max_l3_router }} max_l3_agents_per_router = {{ max_l3_router }}
{% if neutron_provider_networks.network_mappings_list is defined %} {% if neutron_provider_networks.network_mappings_list is defined and ((neutron_provider_networks.network_mappings_list | length) > 0) %}
ha_network_type = {{ neutron_provider_networks.network_mappings_list[0].split(':')[0] }} ha_network_type = {{ neutron_provider_networks.network_mappings_list[0].split(':')[0] }}
ha_network_physical_name = {{ neutron_provider_networks.network_mappings_list[0].split(':')[-1] }} ha_network_physical_name = {{ neutron_provider_networks.network_mappings_list[0].split(':')[-1] }}
{% endif %} {% endif %}

View File

@ -3,7 +3,7 @@
# Linux bridge agent physical interface mappings # Linux bridge agent physical interface mappings
[linux_bridge] [linux_bridge]
{% if neutron_provider_networks.network_mappings is defined %} {% if neutron_provider_networks.network_mappings is defined and ((neutron_provider_networks.network_mappings | length) > 0) %}
physical_interface_mappings = {{ neutron_provider_networks.network_mappings }} physical_interface_mappings = {{ neutron_provider_networks.network_mappings }}
{% endif %} {% endif %}

View File

@ -4,7 +4,7 @@
{% if neutron_tunnel_types | length > 0 %} {% if neutron_tunnel_types | length > 0 %}
local_ip = {{ neutron_local_ip }} local_ip = {{ neutron_local_ip }}
{% endif %} {% endif %}
{% if neutron_provider_networks.network_mappings is defined %} {% if neutron_provider_networks.network_mappings is defined and ((neutron_provider_networks.network_mappings | length) > 0) %}
bridge_mappings = {{ neutron_provider_networks.network_mappings }} bridge_mappings = {{ neutron_provider_networks.network_mappings }}
{% endif %} {% endif %}