From b23db35bbb4311eeb30eb1ea84affeefa5491f61 Mon Sep 17 00:00:00 2001 From: "yolanda.robla@canonical.com" <> Date: Fri, 5 Apr 2013 15:29:39 +0200 Subject: [PATCH 1/2] added host to ceilometer.conf file --- hooks/hooks.py | 1 + revision | 2 +- templates/ceilometer.conf | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hooks/hooks.py b/hooks/hooks.py index 5da9988..9225e44 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -38,6 +38,7 @@ def render_ceilometer_conf(context): if (context and os.path.exists(ceilometer_utils.CEILOMETER_CONF)): # merge contexts context['service_port'] = ceilometer_utils.CEILOMETER_PORT + context['ceilometer_host'] = utils.get_unit_hostname() with open(ceilometer_utils.CEILOMETER_CONF, "w") as conf: conf.write(utils.render_template( diff --git a/revision b/revision index b6a7d89..98d9bcb 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -16 +17 diff --git a/templates/ceilometer.conf b/templates/ceilometer.conf index 7fee04c..a3d225e 100644 --- a/templates/ceilometer.conf +++ b/templates/ceilometer.conf @@ -12,3 +12,4 @@ os_tenant_name = {{ keystone_os_tenant }} os_username = {{ keystone_os_username }} os_password = {{ keystone_os_password }} logdir = /var/log/ceilometer +host = {{ ceilometer_host }} From 5da4882bc9ada30062f2436cce73c3353532a838 Mon Sep 17 00:00:00 2001 From: "yolanda.robla@canonical.com" <> Date: Fri, 5 Apr 2013 15:46:02 +0200 Subject: [PATCH 2/2] added modifications in nova config file --- hooks/ceilometer_utils.py | 6 +++++- hooks/hooks.py | 2 ++ revision | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hooks/ceilometer_utils.py b/hooks/ceilometer_utils.py index cb228b3..95026b2 100644 --- a/hooks/ceilometer_utils.py +++ b/hooks/ceilometer_utils.py @@ -54,8 +54,12 @@ def modify_config_file(nova_conf, values): with open(nova_conf, "w") as f: config.write(f) - f.close() + + # add line at the end, it's a dupe and configparser doesn't handle it + with open(nova_conf, "a") as f: + f.write("notification_driver=nova.openstack.common.notifier.rabbit_notifier\n") + except IOError as e: juju_log('ERROR', 'Error updating nova config file') sys.exit(1) diff --git a/hooks/hooks.py b/hooks/hooks.py index 9225e44..b8df524 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -10,6 +10,8 @@ import ceilometer_utils def install(): utils.configure_source() utils.install(*ceilometer_utils.CEILOMETER_AGENT_PACKAGES) + ceilometer_utils.modify_config_file(ceilometer_utils.NOVA_CONF, + ceilometer_utils.NOVA_SETTINGS) port = ceilometer_utils.CEILOMETER_PORT utils.expose(port) diff --git a/revision b/revision index 98d9bcb..3c03207 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -17 +18