

def _plugin_for_resource(collection):
    if (collection in router.RESOURCES.values()):
        return manager.NeutronManager.get_plugin()
    ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
    ext_res_mappings = dict(((ext.get_alias(), collection) for ext in ext_mgr.extensions.values() if (alias in ext.get_extended_resources('2.0'))))
    LOG.debug('Extension mappings for: %(collection)s: %(aliases)s', {
        'collection': collection,
        'aliases': ext_res_mappings.keys(),
    })
    for plugin in ext_mgr.plugins.values():
        ext_aliases = ext_mgr.get_plugin_supported_extension_aliases(plugin)
        for alias in ext_aliases:
            if ((alias in ext_res_mappings) and hasattr(plugin, ('get_%s' % collection))):
                return plugin
    LOG.warning(_LW('No plugin found for: %s'), collection)

dataset/ETHPy150Open openstack/neutron/neutron/pecan_wsgi/startup.py _plugin_for_resource/VarMisuse@71/93 `collection`->`alias`