From 593aa3db3d94a1cd8024a64b7af865387483c21e Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Wed, 19 Jun 2013 07:17:30 +0100 Subject: Remove the unused notifier.add_driver() API This was only needed to support the plugins framework which is now removed. Change-Id: Id3d08c23f7791bfef9739f1f65af844fd429777c --- openstack/common/notifier/api.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'openstack') diff --git a/openstack/common/notifier/api.py b/openstack/common/notifier/api.py index dc4f578..492b906 100644 --- a/openstack/common/notifier/api.py +++ b/openstack/common/notifier/api.py @@ -157,29 +157,16 @@ def _get_drivers(): if _drivers is None: _drivers = {} for notification_driver in CONF.notification_driver: - add_driver(notification_driver) - + try: + driver = importutils.import_module(notification_driver) + _drivers[notification_driver] = driver + except ImportError: + LOG.exception(_("Failed to load notifier %s. " + "These notifications will not be sent.") % + notification_driver) return _drivers.values() -def add_driver(notification_driver): - """Add a notification driver at runtime.""" - # Make sure the driver list is initialized. - _get_drivers() - if isinstance(notification_driver, basestring): - # Load and add - try: - driver = importutils.import_module(notification_driver) - _drivers[notification_driver] = driver - except ImportError: - LOG.exception(_("Failed to load notifier %s. " - "These notifications will not be sent.") % - notification_driver) - else: - # Driver is already loaded; just add the object. - _drivers[notification_driver] = notification_driver - - def _reset_drivers(): """Used by unit tests to reset the drivers.""" global _drivers -- cgit