Fix Notifications

Conditionally include Service ID for create/delete instance
    Removed old configuration for Exists Notifications

Change-Id: Id2d87b6dffff00479c9ef0ecd8dd77e3e1e3eb47
Fixes: bug #1192384
This commit is contained in:
justin-hopper 2013-06-18 17:08:39 -07:00
parent 7d1fc28dfc
commit b0834124e8
3 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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"),

View File

@ -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))