Allow switch ports to be excluded from NGS trunk port list

Currently we use the switch interface descriptions in the
switch_interface_config variable with the
kolla_neutron_ml2_generic_switch_trunk_port_hosts variable to generate a list
of ports for each switch that should be added as trunk ports to all networks.

This change allows switch interfaces to be given an 'ngs_trunk_port' boolean
field which can be used to exclude matching interfaces from the list. This
may be useful in cases where a host has multiple interfaces but only some
should be added as trunk ports.
This commit is contained in:
Mark Goddard 2017-09-08 16:18:39 +00:00
parent 1216fec5e3
commit a62ad6b0d3

View File

@ -27,7 +27,8 @@ def switch_interface_config_select_description(switch_interface_config, descript
return {
name: config
for name, config in switch_interface_config.items()
if config.get('description') in descriptions
if (config.get('description') in descriptions and
config.get('ngs_trunk_port', True))
}