This commit is contained in:
Edward Hope-Morley 2015-03-03 14:24:10 +08:00
parent 6c466e2c87
commit 53bfb48db3
2 changed files with 10 additions and 2 deletions

View File

@ -18,6 +18,7 @@ from charmhelpers.contrib.network.ip import get_address_in_network
from charmhelpers.contrib.openstack.neutron import (
parse_bridge_mappings,
parse_data_port_mappings,
parse_vlan_range_mappings,
)
from charmhelpers.contrib.openstack.context import (
NeutronPortContext,
@ -148,6 +149,13 @@ class OVSPluginContext(context.NeutronContext):
if mappings:
ovs_ctxt['bridge_mappings'] = mappings
vlan_ranges = config('vlan-ranges')
vlan_range_mappings = parse_vlan_range_mappings(config('vlan-ranges'))
if vlan_ranges:
providers = vlan_range_mappings.keys()
ovs_ctxt['network_providers'] = ' '.join(providers)
ovs_ctxt['vlan_ranges'] = vlan_ranges
return ovs_ctxt

View File

@ -16,10 +16,10 @@ tunnel_id_ranges = 1:1000
vni_ranges = 1001:2000
[ml2_type_vlan]
network_vlan_ranges = physnet1:1000:2000
network_vlan_ranges = {{ vlan_ranges }}
[ml2_type_flat]
flat_networks = physnet1
flat_networks = {{ network_providers }}
[ovs]
enable_tunneling = True