diff options
| author | Andrew Bogott <abogott@wikimedia.org> | 2012-07-19 03:34:31 -0500 |
|---|---|---|
| committer | Andrew Bogott <abogott@wikimedia.org> | 2012-08-02 18:11:37 -0500 |
| commit | c767e9beffe4b826eac869ce7e2eef2cc1499bbe (patch) | |
| tree | 71e7bb4e8495db8e924ab355483781df32a6190e /openstack/common/plugin | |
| parent | bcb424dd730a977aeaae9f6e33e9bb35cbc0c062 (diff) | |
| download | oslo-c767e9beffe4b826eac869ce7e2eef2cc1499bbe.tar.gz oslo-c767e9beffe4b826eac869ce7e2eef2cc1499bbe.tar.xz oslo-c767e9beffe4b826eac869ce7e2eef2cc1499bbe.zip | |
Add multiple-driver support to the notifier api.
Move all of the functionality previously provided by the list_notifier
into the basic notifier api. Move and restructure tests accordingly.
Remove the list_notifier file and test file.
For bug 1025820
Change-Id: Idf7cb975dd78e9951188781622a4d10ca466b154
Diffstat (limited to 'openstack/common/plugin')
| -rw-r--r-- | openstack/common/plugin/plugin.py | 1 | ||||
| -rw-r--r-- | openstack/common/plugin/pluginmanager.py | 21 |
2 files changed, 2 insertions, 20 deletions
diff --git a/openstack/common/plugin/plugin.py b/openstack/common/plugin/plugin.py index 9f06342..dc41f3d 100644 --- a/openstack/common/plugin/plugin.py +++ b/openstack/common/plugin/plugin.py @@ -14,7 +14,6 @@ # under the License. from openstack.common import log as logging -from openstack.common.notifier import list_notifier LOG = logging.getLogger(__name__) diff --git a/openstack/common/plugin/pluginmanager.py b/openstack/common/plugin/pluginmanager.py index d9b6bc3..b10ce46 100644 --- a/openstack/common/plugin/pluginmanager.py +++ b/openstack/common/plugin/pluginmanager.py @@ -19,7 +19,7 @@ import pkg_resources from openstack.common import cfg from openstack.common import log as logging -from openstack.common.notifier import list_notifier +from openstack.common.notifier import api as notifier_api CONF = cfg.CONF @@ -53,17 +53,6 @@ class PluginManager(object): self._service_name = service_name self.plugins = [] - def _force_use_list_notifier(self): - if (CONF.notification_driver != - 'openstack.common.notifier.list_notifier'): - if not hasattr(CONF, "list_notifier_drivers"): - CONF.list_notifier_drivers = [] - old_notifier = CONF.notification_driver - drvstring = 'openstack.common.notifier.list_notifier' - CONF.notification_driver = drvstring - if old_notifier: - list_notifier.add_driver(old_notifier) - def load_plugins(self): self.plugins = [] @@ -77,16 +66,10 @@ class PluginManager(object): LOG.error(_("Failed to load plugin %(plug)s: %(exc)s") % {'plug': entrypoint, 'exc': exc}) - # See if we need to turn on the list notifier - for plugin in self.plugins: - if plugin.notifiers: - self._force_use_list_notifier() - break - # Register individual notifiers. for plugin in self.plugins: for notifier in plugin.notifiers: - list_notifier.add_driver(notifier) + notifier_api.add_driver(notifier) def plugin_extension_factory(self, ext_mgr): for plugin in self.plugins: |
