summaryrefslogtreecommitdiff
path: root/nova/notifications.py
diff options
context:
space:
mode:
authorDavanum Srinivas <davanum@gmail.com>2015-01-30 15:57:36 -0800
committerDavanum Srinivas <davanum@gmail.com>2015-02-04 08:26:14 -0500
commitd1c65d339a091751deb9f1e5b0a574af86655bec (patch)
tree29aa223fd4ac34ff84d57c38c0459110bc36027a /nova/notifications.py
parenta219393c8c6cb935721e45271f8108c0a51571db (diff)
downloadnova-d1c65d339a091751deb9f1e5b0a574af86655bec.tar.gz
Ensure publisher_id is set correctly in notifications
We need to pass the service parameter else the publisher_id is set to "None.node-1". There are many code paths that end up in get_noftifier, so let's just handle it there just like we default to CONF.host. Also the self.notifier in the resource_tracker was not being used, so get rid of it. Closes-Bug: #1416435 Change-Id: I8838b961e49496cc85913a04bd99f9845ff308c3
Diffstat (limited to 'nova/notifications.py')
-rw-r--r--nova/notifications.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/nova/notifications.py b/nova/notifications.py
index d227795dec..e434269918 100644
--- a/nova/notifications.py
+++ b/nova/notifications.py
@@ -81,7 +81,8 @@ def notify_decorator(name, fn):
ctxt = common_context.get_context_from_function_and_args(
fn, args, kwarg)
- notifier = rpc.get_notifier(publisher_id=(CONF.default_publisher_id
+ notifier = rpc.get_notifier('api',
+ publisher_id=(CONF.default_publisher_id
or CONF.host))
method = notifier.getattr(CONF.default_notification_level.lower(),
'info')
@@ -103,7 +104,8 @@ def send_api_fault(url, status, exception):
rpc.get_notifier('api').error(None, 'api.fault', payload)
-def send_update(context, old_instance, new_instance, service=None, host=None):
+def send_update(context, old_instance, new_instance, service="compute",
+ host=None):
"""Send compute.instance.update notification to report any changes occurred
in that instance
"""