diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2013-06-19 07:17:30 +0100 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2013-07-16 16:09:31 +0100 |
| commit | 593aa3db3d94a1cd8024a64b7af865387483c21e (patch) | |
| tree | b658db089682862f56ade0faf188face8c233c7f /openstack/common | |
| parent | 6b547a7551d7b1ec174fc099d796b4638313630a (diff) | |
| download | oslo-593aa3db3d94a1cd8024a64b7af865387483c21e.tar.gz oslo-593aa3db3d94a1cd8024a64b7af865387483c21e.tar.xz oslo-593aa3db3d94a1cd8024a64b7af865387483c21e.zip | |
Remove the unused notifier.add_driver() API
This was only needed to support the plugins framework which is now
removed.
Change-Id: Id3d08c23f7791bfef9739f1f65af844fd429777c
Diffstat (limited to 'openstack/common')
| -rw-r--r-- | openstack/common/notifier/api.py | 27 |
1 files changed, 7 insertions, 20 deletions
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 |
