Merge "Populate flat networks in ml2 configuration"

This commit is contained in:
Zuul 2019-04-23 14:35:42 +00:00 committed by Gerrit Code Review
commit 93251ad37f
2 changed files with 11 additions and 2 deletions

View File

@ -1180,8 +1180,6 @@ data:
metadata_port: 80
plugins:
ml2_conf:
ml2_type_flat:
flat_networks: public
ml2:
mechanism_drivers: openvswitch,sriovnicswitch,l2population
path_mtu: 0

View File

@ -334,11 +334,22 @@ class NeutronHelm(openstack.OpenstackBaseHelm):
return ",".join(ml2_physical_network_mtus)
def _get_flat_networks(self):
flat_nets = []
datanetworks = self.dbapi.datanetworks_get_all()
for datanetwork in datanetworks:
if datanetwork.network_type == constants.DATANETWORK_TYPE_FLAT:
flat_nets.append(str(datanetwork.name))
return ",".join(flat_nets)
def _get_neutron_ml2_config(self):
ml2_config = {
'ml2': {
'physical_network_mtus': self._get_ml2_physical_network_mtus()
},
'ml2_type_flat': {
'flat_networks': self._get_flat_networks()
}
}
LOG.info("_get_neutron_ml2_config=%s" % ml2_config)
return ml2_config