diff --git a/hooks/neutron_api_context.py b/hooks/neutron_api_context.py index 240fa1b3..25c6ac34 100644 --- a/hooks/neutron_api_context.py +++ b/hooks/neutron_api_context.py @@ -236,11 +236,16 @@ class HAProxyContext(context.HAProxyContext): return ctxt -class NeutronApiSDNContext(context.OSContextGenerator): - interfaces = ['neutron-test'] +class NeutronApiSDNContext(context.SubordinateConfigContext): + interfaces = 'neutron-test' + + def __init__(self): + super(NeutronApiSDNContext, self).__init__(interface='neutron-test', + service='neutron-api', + config_file='/etc/neutron/neutron.conf') def __call__(self): - ctxt = {} + ctxt = super(NeutronApiSDNContext, self).__call__() defaults = { 'core-plugin': { 'templ_key': 'core_plugin', @@ -262,9 +267,7 @@ class NeutronApiSDNContext(context.OSContextGenerator): for rid in relation_ids('neutron-test'): for unit in related_units(rid): rdata = relation_get(rid=rid, unit=unit) - ctxt = { - 'neutron_plugin': rdata.get('neutron-plugin'), - } + ctxt['neutron_plugin'] = rdata.get('neutron-plugin') if not context.context_complete(ctxt): continue for key in defaults.keys(): diff --git a/hooks/neutron_api_utils.py b/hooks/neutron_api_utils.py index a1fc6389..ca105a0e 100644 --- a/hooks/neutron_api_utils.py +++ b/hooks/neutron_api_utils.py @@ -233,6 +233,7 @@ def resource_map(): context.PostgresqlDBContext(database=config('database'))) else: + print "Adding NeutronApiSDNContext" resource_map[NEUTRON_CONF]['contexts'].append( neutron_api_context.NeutronApiSDNContext() ) diff --git a/templates/kilo/neutron.conf b/templates/kilo/neutron.conf index 5afd6e5c..bf62a467 100644 --- a/templates/kilo/neutron.conf +++ b/templates/kilo/neutron.conf @@ -59,6 +59,12 @@ nova_admin_auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/v2.0 {% include "section-zeromq" %} +{% if sections and 'DEFAULT' in sections -%} +{% for key, value in sections['DEFAULT'] -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif %} + [quotas] quota_driver = neutron.db.quota_db.DbQuotaDriver {% if neutron_security_groups -%} @@ -77,6 +83,11 @@ quota_member = {{ quota_member }} quota_health_monitors = {{ quota_health_monitors }} quota_router = {{ quota_router }} quota_floatingip = {{ quota_floatingip }} +{% if sections and 'quotas' in sections -%} +{% for key, value in sections['quotas'] -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif %} [agent] root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf @@ -86,11 +97,26 @@ root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf {% include "parts/section-database" %} {% include "section-rabbitmq-oslo" %} +{% if sections and 'agent' in sections -%} +{% for key, value in sections['agent'] -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif %} [service_providers] service_provider=LOADBALANCER:Haproxy:neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default service_provider=VPN:openswan:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default service_provider=FIREWALL:Iptables:neutron_fwaas.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default +{% if sections and 'service_providers' in sections -%} +{% for key, value in sections['service_providers'] -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif %} [oslo_concurrency] lock_path = $state_path/lock +{% if sections and 'oslo_concurrency' in sections -%} +{% for key, value in sections['oslo_concurrency'] -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif %}