summaryrefslogtreecommitdiff
path: root/ironic/openstack/common/notifier/log_notifier.py
diff options
context:
space:
mode:
authorLucas Alvares Gomes <lucasagomes@gmail.com>2014-04-16 15:37:23 +0100
committerLucas Alvares Gomes <lucasagomes@gmail.com>2014-04-25 22:46:44 +0100
commit69dc8400db6e0c2b1b2be83f06f8ef15638cd54e (patch)
tree3819e9d8f9bf25b00ce44f8fc206ed800133a50d /ironic/openstack/common/notifier/log_notifier.py
parent580ee8f065b377a853e94116bff98a13cec49ff4 (diff)
downloadironic-69dc8400db6e0c2b1b2be83f06f8ef15638cd54e.tar.gz
Port to oslo.messaging
The oslo.messaging library takes the existing RPC code from oslo and wraps it in a sane API with well defined semantics around which we can make a commitment to retain compatibility in future. The patch is large and hard to be split into different patches, but the changes can be summarized as: * Remove openstack/common/{rpc, notifier, log_handler} modules dependency (superceded by oslo.messaging) * New config option `conductor.workers_pool_size` add to determine the size of the workers greenthread pool. * PeriodicService class refactored and renamed to RPCService, all periodic tasks methods were moved to the ConductorManager class leaving RPCService class to be resposable for setting up and starting the RPCServer from oslo.messaging only. * In oslo.messaging, a request context is expected to be a dict so the method RequestContext.{to,from}_dict() was updated/added to the module. * The allowed_rpc_exception_modules configuration option is replaced by an allowed_remote_exmods get_transport() parameter. This is not something that users ever need to configure, but it is something each project using oslo.messaging needs to be able to customize. * New common/rpc.py module added to wrap the global messaging state. It also contains transport aliases for backwards compatibility with IceHouse rpc_backend configuration values. blueprint: oslo-messaging Change-Id: I454e8898baed002a1cddb9eb76492ae9c2f1212b
Diffstat (limited to 'ironic/openstack/common/notifier/log_notifier.py')
-rw-r--r--ironic/openstack/common/notifier/log_notifier.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/ironic/openstack/common/notifier/log_notifier.py b/ironic/openstack/common/notifier/log_notifier.py
deleted file mode 100644
index 04b1a3afa..000000000
--- a/ironic/openstack/common/notifier/log_notifier.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2011 OpenStack Foundation.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo.config import cfg
-
-from ironic.openstack.common import jsonutils
-from ironic.openstack.common import log as logging
-
-
-CONF = cfg.CONF
-
-
-def notify(_context, message):
- """Notifies the recipient of the desired event given the model.
-
- Log notifications using OpenStack's default logging system.
- """
-
- priority = message.get('priority',
- CONF.default_notification_level)
- priority = priority.lower()
- logger = logging.getLogger(
- 'ironic.openstack.common.notification.%s' %
- message['event_type'])
- getattr(logger, priority)(jsonutils.dumps(message))