Drop unused method

As described in the TODO comment, this method is not at all used.

Also loose the minimum boundary of coverage percentage, because
the limit matches the exact percentage of current tests and can be
easily broken.

Change-Id: Idd9f4ade3911b21691f220c5eafa09463689b8b3
This commit is contained in:
Takashi Kajinami
2025-06-20 21:47:40 +09:00
parent b8e21fd54e
commit fbdd642df6
3 changed files with 1 additions and 29 deletions

View File

@@ -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[

View File

@@ -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'))

View File

@@ -181,7 +181,7 @@ setenv =
commands =
stestr run --no-subunit-trace {posargs}
coverage combine
coverage report --fail-under=82 --skip-covered
coverage report --fail-under=80 --skip-covered
coverage html -d cover
coverage xml -o cover/coverage.xml