diff options
author | Mark McLoughlin <markmc@redhat.com> | 2013-08-29 22:38:31 +0100 |
---|---|---|
committer | Mark McLoughlin <markmc@redhat.com> | 2013-09-05 06:26:01 +0100 |
commit | 60a91f475a352e5e86bbd07b510cb32874110fef (patch) | |
tree | 5a973e4a7958e45849dcd1b9fe46d5c01581f749 /nova/manager.py | |
parent | 11f6413dc911ffbab3c3782fae9548306a1c47c7 (diff) | |
download | nova-60a91f475a352e5e86bbd07b510cb32874110fef.tar.gz |
Port to oslo.messaging.Notifier API
Add a temporary nova.notifier.Notifier helper class which translates
oslo.messaging.Notifier compatible calls into openstack.common.notifier
compatible calls.
This allows us to port the notifier code over to the oslo.messaging API
before actually switching over oslo.messaging fully.
This patch contains no functional changes at all, except that all
notifications go through this temporary helper class.
Some notes on the new API:
* The notifier API is changed so that what was previously global state
is now encapsulated in a Notifier object. This object also includes
the publisher_id and has error()/info()/etc. methods rather than
just notify().
* The notify_decorator() helper wasn't carried across to the new API
because its semantics are a bit weird. Something along these lines
could be added in future, though.
* We use a fake Notifier implementation for tests because there's no
API in oslo.messaging to actually get the notifications queued
up in the fake notification driver, which is a bit dumb. However,
this feels like the right thing to do anyway. We're not wanting
to test oslo.messaging.Notifier itself, but rather we want to test
how we call it.
blueprint: oslo-messaging
Change-Id: I262163c7e05e6a6fb79265e904ce761fc3ac5806
Diffstat (limited to 'nova/manager.py')
-rw-r--r-- | nova/manager.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/manager.py b/nova/manager.py index a270b927b7..68c8f9449d 100644 --- a/nova/manager.py +++ b/nova/manager.py @@ -57,6 +57,7 @@ from oslo.config import cfg from nova import baserpc from nova.db import base +from nova import notifier from nova.objects import base as objects_base from nova.openstack.common.gettextutils import _ from nova.openstack.common import log as logging @@ -80,6 +81,7 @@ class Manager(base.Base, periodic_task.PeriodicTasks): self.host = host self.backdoor_port = None self.service_name = service_name + self.notifier = notifier.get_notifier(self.service_name, self.host) super(Manager, self).__init__(db_driver) def create_rpc_dispatcher(self, backdoor_port=None, additional_apis=None): |