diff --git a/templates/neutron.conf.j2 b/templates/neutron.conf.j2 index 24d5f55e..561c1a71 100644 --- a/templates/neutron.conf.j2 +++ b/templates/neutron.conf.j2 @@ -71,7 +71,7 @@ agent_down_time = {{ neutron_agent_down_time }} l3_ha = True l3_ha_net_cidr = {{ neutron_l3_ha_net_cidr }} 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_physical_name = {{ neutron_provider_networks.network_mappings_list[0].split(':')[-1] }} {% endif %} diff --git a/templates/plugins/ml2/linuxbridge_agent.ini.j2 b/templates/plugins/ml2/linuxbridge_agent.ini.j2 index ddbd0225..822d5d38 100644 --- a/templates/plugins/ml2/linuxbridge_agent.ini.j2 +++ b/templates/plugins/ml2/linuxbridge_agent.ini.j2 @@ -3,7 +3,7 @@ # Linux bridge agent physical interface mappings [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 }} {% endif %} diff --git a/templates/plugins/ml2/openvswitch_agent.ini.j2 b/templates/plugins/ml2/openvswitch_agent.ini.j2 index d65a8557..058c8970 100644 --- a/templates/plugins/ml2/openvswitch_agent.ini.j2 +++ b/templates/plugins/ml2/openvswitch_agent.ini.j2 @@ -4,7 +4,7 @@ {% if neutron_tunnel_types | length > 0 %} local_ip = {{ neutron_local_ip }} {% 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 }} {% endif %}