From 8db8e279563dd1b3c6742c10543c2bd182de4f65 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 10 Jun 2014 10:32:31 +0000 Subject: [PATCH] Write all configs (need to include neutron-server) and pickup subordinate settings in neutron-server template --- hooks/neutron_api_hooks.py | 4 ++-- hooks/neutron_api_utils.py | 2 +- templates/icehouse/neutron-server | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hooks/neutron_api_hooks.py b/hooks/neutron_api_hooks.py index 21f1bd82..fcec9d97 100755 --- a/hooks/neutron_api_hooks.py +++ b/hooks/neutron_api_hooks.py @@ -232,7 +232,7 @@ def neutron_api_relation_joined(rid=None): @hooks.hook('neutron-api-relation-changed') @restart_on_change(restart_map()) def neutron_api_relation_changed(): - CONFIGS.write(NEUTRON_CONF) + CONFIGS.write_all() @hooks.hook('neutron-plugin-relation-joined') def neutron_plugin_relation_joined(rid=None, remote_restart=False): @@ -245,7 +245,7 @@ def neutron_plugin_relation_joined(rid=None, remote_restart=False): @restart_on_change(restart_map()) @hooks.hook('neutron-plugin-relation-changed') def neutron_plugin_relation_changed(): - CONFIGS.write(NEUTRON_CONF) + CONFIGS.write_all() def main(): try: diff --git a/hooks/neutron_api_utils.py b/hooks/neutron_api_utils.py index 34911378..19acf445 100644 --- a/hooks/neutron_api_utils.py +++ b/hooks/neutron_api_utils.py @@ -68,7 +68,7 @@ BASE_RESOURCE_MAP = OrderedDict([ 'contexts': [context.SubordinateConfigContext( interface='neutron-plugin', service='neutron', - config_file=NEUTRON_CONF)], + config_file=NEUTRON_DEFAULT)], }), ]) def api_port(service): diff --git a/templates/icehouse/neutron-server b/templates/icehouse/neutron-server index f59c779f..5688680a 100644 --- a/templates/icehouse/neutron-server +++ b/templates/icehouse/neutron-server @@ -3,4 +3,10 @@ # [ WARNING ] # Configuration file maintained by Juju. Local changes may be overwritten. ############################################################################### -NEUTRON_PLUGIN_CONFIG="{{ plugin_conf_file }}" +{% if sections and 'DEFAULT' in sections -%} +{% for key, value in sections['DEFAULT'] -%} +{{ key }} = "{{ value }}" +{% endfor -%} +{% else -%} +NEUTRON_PLUGIN_CONFIG="" +{% endif -%}