Set l2_population in the local neutron_api ml2 conf

This commit is contained in:
Liam Young 2014-09-04 12:58:55 +00:00
parent a21d7b6225
commit e64b748242
3 changed files with 10 additions and 5 deletions

View File

@ -10,6 +10,9 @@ from charmhelpers.contrib.hahelpers.cluster import (
determine_apache_port,
)
def get_l2population():
plugin = config('neutron-plugin')
return config('l2-population') if plugin == "ovs" else False
class ApacheSSLContext(context.ApacheSSLContext):
@ -49,6 +52,10 @@ class NeutronCCContext(context.NeutronContext):
def neutron_security_groups(self):
return config('neutron-security-groups')
@property
def neutron_l2_population(self):
return get_l2population()
# Do not need the plugin agent installed on the api server
def _ensure_packages(self):
pass
@ -60,6 +67,7 @@ class NeutronCCContext(context.NeutronContext):
def __call__(self):
from neutron_api_utils import api_port
ctxt = super(NeutronCCContext, self).__call__()
ctxt['l2_population'] = self.neutron_l2_population
ctxt['external_network'] = config('neutron-external-network')
ctxt['verbose'] = config('verbose')
ctxt['debug'] = config('debug')

View File

@ -43,6 +43,7 @@ from neutron_api_utils import (
CLUSTER_RES,
do_openstack_upgrade,
)
from neutron_api_context import get_l2population
from charmhelpers.contrib.hahelpers.cluster import (
get_hacluster_config,
@ -210,11 +211,6 @@ def identity_changed():
configure_https()
def get_l2population():
plugin = config('neutron-plugin')
return config('l2-population') if plugin == "ovs" else False
@hooks.hook('neutron-api-relation-joined')
def neutron_api_relation_joined(rid=None):
base_url = canonical_url(CONFIGS, INTERNAL)

View File

@ -20,6 +20,7 @@ local_ip = {{ local_ip }}
[agent]
tunnel_types = gre
l2_population = {{ l2_population }}
[securitygroup]
{% if neutron_security_groups -%}