From b0834124e8bc917cbb6ed2881234ff4b33826f44 Mon Sep 17 00:00:00 2001 From: justin-hopper Date: Tue, 18 Jun 2013 17:08:39 -0700 Subject: [PATCH] Fix Notifications Conditionally include Service ID for create/delete instance Removed old configuration for Exists Notifications Change-Id: Id2d87b6dffff00479c9ef0ecd8dd77e3e1e3eb47 Fixes: bug #1192384 --- etc/trove/trove-taskmanager.conf.sample | 1 - trove/common/cfg.py | 6 ++---- trove/taskmanager/models.py | 5 +++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/etc/trove/trove-taskmanager.conf.sample b/etc/trove/trove-taskmanager.conf.sample index 964fd0e195..082b280970 100644 --- a/etc/trove/trove-taskmanager.conf.sample +++ b/etc/trove/trove-taskmanager.conf.sample @@ -53,7 +53,6 @@ trove_auth_url = http://0.0.0.0:5000/v2.0 taskmanager_manager=trove.taskmanager.manager.Manager # Manager sends Exists Notifications -taskmanager_exists_notification = True exists_notification_transformer = trove.extensions.mgmt.instances.models.NovaNotificationTransformer exists_notification_ticks = 30 notification_service_id = 2f3ff068-2bfb-4f70-9a9d-a6bb65bc084b diff --git a/trove/common/cfg.py b/trove/common/cfg.py index 5f29996382..cfa4066aa3 100644 --- a/trove/common/cfg.py +++ b/trove/common/cfg.py @@ -160,14 +160,12 @@ common_opts = [ default='trove.common.remote.nova_volume_client'), cfg.StrOpt('remote_swift_client', default='trove.common.remote.swift_client'), - cfg.BoolOpt('taskmanager_exists_notification', default=False, - help='Toggles Task Manager to send out exists notifications'), - cfg.StrOpt('exists_notification_transformer', default=None, + cfg.StrOpt('exists_notification_transformer', help='Transformer for exists notifications'), cfg.IntOpt('exists_notification_ticks', default=360, help='Number of report_intevals to wait between pushing events ' '(see report_interval)'), - cfg.StrOpt('notification_service_id', default='', + cfg.StrOpt('notification_service_id', help='Unique ID to tag notification events'), cfg.StrOpt('nova_proxy_admin_user', default='', help="Admin username used to connect to Nova"), diff --git a/trove/taskmanager/models.py b/trove/taskmanager/models.py index 60121f350c..0f517ec072 100644 --- a/trove/taskmanager/models.py +++ b/trove/taskmanager/models.py @@ -98,6 +98,11 @@ class NotifyMixin(object): 'nova_volume_id': self.volume_id }) + if CONF.notification_service_id: + payload.update({ + 'service_id': CONF.notification_service_id + }) + # Update payload with all other kwargs payload.update(kwargs) LOG.debug('Sending event: %s, %s' % (event_type, payload))