From 36c6bb01b160a5b9be9d0622d34515e62808c52a Mon Sep 17 00:00:00 2001 From: "yolanda.robla@canonical.com" <> Date: Thu, 14 Feb 2013 20:47:39 +0100 Subject: [PATCH] fixes in config and packages --- hooks/ceilometer_utils.py | 11 ++++++----- hooks/hooks.py | 2 +- hooks/utils.py | 2 +- revision | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/hooks/ceilometer_utils.py b/hooks/ceilometer_utils.py index ff2012e..aa2c1a3 100644 --- a/hooks/ceilometer_utils.py +++ b/hooks/ceilometer_utils.py @@ -4,8 +4,9 @@ import uuid NOVA_CONF = "/etc/nova/nova.conf" CEILOMETER_CONF = "/etc/ceilometer/ceilometer.conf" CEILOMETER_COMPUTE_SERVICES = ['ceilometer-agent-compute'] -CEILOMETER_PACKAGES = ['ceilometer-common', 'ceilometer-agent-compute'] -NOVA_SETTINGS = ['instance_usage_audit=True', - 'instance_usage_audit_period=hour', - 'notification_driver=nova.openstack.common.notifier.rabbit_notifier', - 'notification_driver=ceilometer.compute.nova_notifier'] +CEILOMETER_PACKAGES = ['python-ceilometer', 'ceilometer-common', 'ceilometer-agent-compute'] +NOVA_SETTINGS = [ + ('DEFAULT', 'instance_usage_audit', 'True'), + ('DEFAULT', 'instance_usage_audit_period', 'hour'), + ('DEFAULT', 'notification_driver', 'nova.openstack.common.notifier.rabbit_notifier'), + ('DEFAULT', 'notification_driver', 'ceilometer.compute.nova_notifier')] diff --git a/hooks/hooks.py b/hooks/hooks.py index 8cef934..3deb6ab 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -11,7 +11,7 @@ def install(): utils.configure_source() utils.install(*ceilometer_utils.CEILOMETER_PACKAGES) utils.modify_config_file(ceilometer_utils.NOVA_CONF, - *ceilometer_utils.NOVA_SETTINGS) + ceilometer_utils.NOVA_SETTINGS) utils.restart(*ceilometer_utils.CEILOMETER_COMPUTE_SERVICES) diff --git a/hooks/utils.py b/hooks/utils.py index 01306ad..9326c98 100644 --- a/hooks/utils.py +++ b/hooks/utils.py @@ -143,7 +143,7 @@ def modify_config_file(nova_conf, values): # add needed config lines - tuple with section,key,value for value in values: config.set(value[0], value[1], value[2]) - config.write() + config.write(f) f.close() except IOError as e: diff --git a/revision b/revision index 7f8f011..48082f7 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -7 +12