Collect l2_population settings from neutron-api unit and set them in the ml2 config
This commit is contained in:
parent
2cc8ced26e
commit
a4b7fedefa
@ -95,6 +95,26 @@ def core_plugin():
|
||||
return CORE_PLUGIN[networking_name()][plugin]
|
||||
|
||||
|
||||
def _neutron_api_settings():
|
||||
'''
|
||||
Inspects current neutron-plugin relation
|
||||
'''
|
||||
neutron_settings = {
|
||||
'l2_population': True,
|
||||
|
||||
}
|
||||
for rid in relation_ids('neutron-plugin-api'):
|
||||
for unit in related_units(rid):
|
||||
rdata = relation_get(rid=rid, unit=unit)
|
||||
if 'l2_population' not in rdata:
|
||||
continue
|
||||
neutron_settings = {
|
||||
'l2_population': rdata['l2-population'],
|
||||
}
|
||||
return neutron_settings
|
||||
return neutron_settings
|
||||
|
||||
|
||||
class NetworkServiceContext(OSContextGenerator):
|
||||
interfaces = ['quantum-network-service']
|
||||
|
||||
@ -163,6 +183,7 @@ class ExternalPortContext(OSContextGenerator):
|
||||
class QuantumGatewayContext(OSContextGenerator):
|
||||
|
||||
def __call__(self):
|
||||
neutron_api_settings = _neutron_api_settings()
|
||||
ctxt = {
|
||||
'shared_secret': get_shared_secret(),
|
||||
'local_ip':
|
||||
@ -172,7 +193,8 @@ class QuantumGatewayContext(OSContextGenerator):
|
||||
'plugin': config('plugin'),
|
||||
'debug': config('debug'),
|
||||
'verbose': config('verbose'),
|
||||
'instance_mtu': config('instance-mtu')
|
||||
'instance_mtu': config('instance-mtu'),
|
||||
'l2_population': neutron_api_settings['l2_population'],
|
||||
}
|
||||
return ctxt
|
||||
|
||||
|
@ -15,5 +15,6 @@ enable_tunneling = True
|
||||
local_ip = {{ local_ip }}
|
||||
[agent]
|
||||
tunnel_types = gre
|
||||
l2_population = {{ l2_population }}
|
||||
[securitygroup]
|
||||
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
|
||||
|
Loading…
x
Reference in New Issue
Block a user