use log api plugin const from neutron-lib
The constant LOG_API was rehomed into neutron-lib with commit I208c976c3e7e43e27e1907ed196af8efccd73f22 This patch consumes it by removing the constant from neutron and using lib's version of it instead. NeutronLibImpact Change-Id: I97b135730af9efaa3b32c99b415f89c8a254a782
This commit is contained in:
parent
96178b5df9
commit
139c8341f4
neutron
extensions
plugins/common
services/logapi/common
tests/unit/services/logapi
@ -18,11 +18,11 @@ import itertools
|
||||
|
||||
from neutron_lib.api.definitions import logging as apidef
|
||||
from neutron_lib.api import extensions as api_extensions
|
||||
from neutron_lib.plugins import constants as plugin_const
|
||||
from neutron_lib.services import base as service_base
|
||||
import six
|
||||
|
||||
from neutron.api.v2 import resource_helper
|
||||
from neutron.plugins.common import constants
|
||||
|
||||
|
||||
class Logging(api_extensions.APIExtensionDescriptor):
|
||||
@ -43,7 +43,7 @@ class Logging(api_extensions.APIExtensionDescriptor):
|
||||
resources = resource_helper.build_resource_info(
|
||||
plural_mappings,
|
||||
apidef.RESOURCE_ATTRIBUTE_MAP,
|
||||
constants.LOG_API,
|
||||
plugin_const.LOG_API,
|
||||
translate_name=True,
|
||||
allow_bulk=True)
|
||||
|
||||
@ -60,7 +60,7 @@ class LoggingPluginBase(service_base.ServicePluginBase):
|
||||
|
||||
@classmethod
|
||||
def get_plugin_type(cls):
|
||||
return constants.LOG_API
|
||||
return plugin_const.LOG_API
|
||||
|
||||
@abc.abstractmethod
|
||||
def get_logs(self, context, filters=None, fields=None, sorts=None,
|
||||
|
@ -17,9 +17,6 @@ from neutron_lib import constants
|
||||
from neutron_lib.plugins import constants as p_const
|
||||
|
||||
|
||||
# TODO(boden): consume once I208c976c3e7e43e27e1907ed196af8efccd73f22 releases
|
||||
LOG_API = "LOGGING"
|
||||
|
||||
# Maps extension alias to service type that
|
||||
# can be implemented by the core plugin.
|
||||
EXT_TO_SERVICE_MAPPING = {
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib.api.definitions import portbindings
|
||||
from neutron_lib.plugins import constants as plugin_const
|
||||
from neutron_lib.plugins import directory
|
||||
from oslo_log import log as logging
|
||||
from sqlalchemy.orm import exc as orm_exc
|
||||
@ -22,7 +23,6 @@ from neutron.db import _utils as db_utils
|
||||
from neutron.db.models import securitygroup as sg_db
|
||||
from neutron.objects import ports
|
||||
from neutron.objects import securitygroup as sg_object
|
||||
from neutron.plugins.common import constants
|
||||
from neutron.services.logapi.common import constants as log_const
|
||||
from neutron.services.logapi.common import exceptions as log_exc
|
||||
|
||||
@ -91,7 +91,7 @@ def validate_log_type_for_port(log_type, port):
|
||||
|
||||
"""
|
||||
|
||||
log_plugin = directory.get_plugin(alias=constants.LOG_API)
|
||||
log_plugin = directory.get_plugin(alias=plugin_const.LOG_API)
|
||||
drivers = log_plugin.driver_manager.drivers
|
||||
for driver in drivers:
|
||||
vif_type = port.binding.vif_type
|
||||
|
@ -16,13 +16,13 @@
|
||||
import mock
|
||||
from neutron_lib.api.definitions import portbindings
|
||||
from neutron_lib import context
|
||||
from neutron_lib.plugins import constants as plugin_const
|
||||
from neutron_lib.plugins import directory
|
||||
from oslo_utils import uuidutils
|
||||
from sqlalchemy.orm import exc as orm_exc
|
||||
|
||||
from neutron.objects import ports
|
||||
from neutron.objects import securitygroup as sg_object
|
||||
from neutron.plugins.common import constants
|
||||
from neutron.services.logapi.common import exceptions as log_exc
|
||||
from neutron.services.logapi.common import validators
|
||||
from neutron.tests import base
|
||||
@ -129,7 +129,7 @@ class TestLogDriversLoggingTypeValidations(drv_mgr.TestLogDriversManagerBase):
|
||||
def __init__(self):
|
||||
self.driver_manager = driver_manager
|
||||
|
||||
directory.add_plugin(constants.LOG_API, FakeLoggingPlugin())
|
||||
directory.add_plugin(plugin_const.LOG_API, FakeLoggingPlugin())
|
||||
|
||||
self.assertEqual(
|
||||
expected_result,
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
import mock
|
||||
from neutron_lib import context
|
||||
from neutron_lib.plugins import constants as plugin_const
|
||||
from neutron_lib.plugins import directory
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import uuidutils
|
||||
@ -23,7 +24,6 @@ from neutron import manager
|
||||
from neutron.objects.logapi import logging_resource as log_object
|
||||
from neutron.objects import ports
|
||||
from neutron.objects import securitygroup as sg_object
|
||||
from neutron.plugins.common import constants
|
||||
from neutron.services.logapi.common import exceptions as log_exc
|
||||
from neutron.tests.unit.services.logapi import base
|
||||
|
||||
@ -51,7 +51,7 @@ class TestLoggingPlugin(base.BaseLogTestCase):
|
||||
["neutron.services.logapi.logging_plugin.LoggingPlugin"])
|
||||
|
||||
manager.init()
|
||||
self.log_plugin = directory.get_plugin(constants.LOG_API)
|
||||
self.log_plugin = directory.get_plugin(plugin_const.LOG_API)
|
||||
self.log_plugin.driver_manager = mock.Mock()
|
||||
log_types = mock.PropertyMock(return_value=SUPPORTED_LOGGING_TYPES)
|
||||
self.log_plugin.driver_manager.supported_logging_types = \
|
||||
|
Loading…
x
Reference in New Issue
Block a user