Merge "Drop unused method"
This commit is contained in:
@@ -274,16 +274,6 @@ class NeutronManager(metaclass=profiler.TracedMeta):
|
||||
resource,
|
||||
res_ctrl_mappings.get(resource.replace('-', '_')))
|
||||
|
||||
# TODO(blogan): This isn't used by anything else other than tests and
|
||||
# probably should be removed
|
||||
@classmethod
|
||||
def get_service_plugin_by_path_prefix(cls, path_prefix):
|
||||
service_plugins = directory.get_unique_plugins()
|
||||
for service_plugin in service_plugins:
|
||||
plugin_path_prefix = getattr(service_plugin, 'path_prefix', None)
|
||||
if plugin_path_prefix and plugin_path_prefix == path_prefix:
|
||||
return service_plugin
|
||||
|
||||
@classmethod
|
||||
def add_resource_for_path_prefix(cls, resource, path_prefix):
|
||||
resources = cls.get_instance().path_prefix_resource_mappings[
|
||||
|
@@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
import weakref
|
||||
|
||||
import fixtures
|
||||
from neutron_lib.plugins import constants as lib_const
|
||||
@@ -248,20 +247,3 @@ class NeutronManagerTestCase(base.BaseTestCase):
|
||||
with testlib_api.ExpectedException(ImportError):
|
||||
manager.NeutronManager.load_class_for_provider(
|
||||
'neutron.core_plugins', 'ml2XXXXXX')
|
||||
|
||||
def test_get_service_plugin_by_path_prefix_3(self):
|
||||
cfg.CONF.set_override("core_plugin", DB_PLUGIN_KLASS)
|
||||
nm = manager.NeutronManager.get_instance()
|
||||
|
||||
class pclass:
|
||||
def __init__(self, path_prefix):
|
||||
self.path_prefix = path_prefix
|
||||
|
||||
x_plugin, y_plugin = pclass('xpa'), pclass('ypa')
|
||||
directory.add_plugin('x', x_plugin)
|
||||
directory.add_plugin('y', y_plugin)
|
||||
self.assertEqual(weakref.proxy(x_plugin),
|
||||
nm.get_service_plugin_by_path_prefix('xpa'))
|
||||
self.assertEqual(weakref.proxy(y_plugin),
|
||||
nm.get_service_plugin_by_path_prefix('ypa'))
|
||||
self.assertIsNone(nm.get_service_plugin_by_path_prefix('abc'))
|
||||
|
Reference in New Issue
Block a user