From 5df2c802d4d77e99fb7291bd0af28375d3ea138c Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 17 Jun 2014 15:31:03 +0100 Subject: [PATCH] General tidyup after initial feedback --- config.yaml | 8 ++++++++ hooks/neutron_ovs_context.py | 7 ++----- hooks/neutron_ovs_hooks.py | 11 ++++------- hooks/upgrade-charm | 1 + metadata.yaml | 2 +- templates/icehouse/neutron.conf | 4 +++- 6 files changed, 19 insertions(+), 14 deletions(-) create mode 120000 hooks/upgrade-charm diff --git a/config.yaml b/config.yaml index 9c40a2f6..e0cbc155 100644 --- a/config.yaml +++ b/config.yaml @@ -13,3 +13,11 @@ options: description: | By default, all services will log into their corresponding log files. Setting this to True will force all services to log to the syslog. + debug: + default: False + type: boolean + description: Enable debug logging + verbose: + default: False + type: boolean + description: Enable verbose logging diff --git a/hooks/neutron_ovs_context.py b/hooks/neutron_ovs_context.py index a294a82c..ebd6c227 100644 --- a/hooks/neutron_ovs_context.py +++ b/hooks/neutron_ovs_context.py @@ -2,10 +2,8 @@ from charmhelpers.core.hookenv import ( relation_ids, related_units, relation_get, - is_relation_made, config, unit_get, - log, ) from charmhelpers.contrib.openstack import context @@ -14,9 +12,6 @@ from charmhelpers.contrib.network.ovs import add_bridge from charmhelpers.contrib.openstack.utils import get_host_ip OVS_BRIDGE = 'br-int' -class OSContextError(Exception): - pass - def _neutron_security_groups(): ''' Inspects current neutron-plugin relation and determine if nova-c-c has @@ -61,4 +56,6 @@ class OVSPluginContext(context.NeutronContext): ovs_ctxt['local_ip'] = get_host_ip(unit_get('private-address')) ovs_ctxt['neutron_security_groups'] = self.neutron_security_groups ovs_ctxt['use_syslog'] = conf['use-syslog'] + ovs_ctxt['verbose'] = conf['verbose'] + ovs_ctxt['debug'] = conf['debug'] return ovs_ctxt diff --git a/hooks/neutron_ovs_hooks.py b/hooks/neutron_ovs_hooks.py index 913e2c49..f29db45c 100755 --- a/hooks/neutron_ovs_hooks.py +++ b/hooks/neutron_ovs_hooks.py @@ -34,14 +34,11 @@ def install(): apt_update() apt_install(determine_packages(), fatal=True) -@restart_on_change(restart_map()) -@hooks.hook('config-changed') -def config_changed(): - CONFIGS.write_all() - -@restart_on_change(restart_map()) +@hooks.hook('upgrade-charm') @hooks.hook('neutron-plugin-relation-changed') -def neutron_plugin_relation_changed(): +@hooks.hook('config-changed') +@restart_on_change(restart_map()) +def config_changed(): CONFIGS.write_all() @hooks.hook('amqp-relation-joined') diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm new file mode 120000 index 00000000..55aa8e52 --- /dev/null +++ b/hooks/upgrade-charm @@ -0,0 +1 @@ +neutron_ovs_hooks.py \ No newline at end of file diff --git a/metadata.yaml b/metadata.yaml index 8d09b884..69a365b2 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,7 +1,7 @@ name: neutron-openvswitch subordinate: true maintainer: Liam Young -summary: "Openstack neutron openvswitch plugin " +summary: "Neutron OpenvSwitch Agent" description: | Openstack neutron openvswitch plugin categories: diff --git a/templates/icehouse/neutron.conf b/templates/icehouse/neutron.conf index 341967a5..964f6dce 100644 --- a/templates/icehouse/neutron.conf +++ b/templates/icehouse/neutron.conf @@ -5,6 +5,9 @@ # Config managed by neutron-openvswitch charm ############################################################################### [DEFAULT] +verbose = {{ verbose }} +debug = {{ debug }} +use_syslog = {{ use_syslog }} state_path = /var/lib/neutron lock_path = $state_path/lock bind_host = 0.0.0.0 @@ -17,7 +20,6 @@ core_plugin = {{ core_plugin }} api_paste_config = /etc/neutron/api-paste.ini auth_strategy = keystone notification_driver = neutron.openstack.common.notifier.rpc_notifier -use_syslog = {{ use_syslog }} default_notification_level = INFO notification_topics = notifications