Ejemplo n.º 1
0
import abc
import contextlib

from neutron_lib import constants
from oslo_concurrency import lockutils
import six

from neutron.agent import agent_extension
from neutron.api.rpc.callbacks.consumer import registry
from neutron.api.rpc.callbacks import events
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.conf.services import logging as log_cfg
from neutron import manager

log_cfg.register_log_driver_opts()

LOGGING_DRIVERS_NAMESPACE = 'neutron.services.logapi.drivers'


@six.add_metaclass(abc.ABCMeta)
class LoggingDriver(object):
    """Defines abstract interface for logging driver"""

    # specific logging types are supported
    SUPPORTED_LOGGING_TYPES = None

    @abc.abstractmethod
    def initialize(self, resource_rpc, **kwargs):
        """Perform logging driver initialization.
        """
Ejemplo n.º 2
0
#    under the License.

from neutron_lib import rpc as n_rpc
from oslo_concurrency import lockutils
from oslo_log import log as logging

from neutron.api.rpc.callbacks.consumer import registry
from neutron.api.rpc.callbacks import events
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.conf.services import logging as log_cfg
from neutron import manager

LOG = logging.getLogger(__name__)

log_cfg.register_log_driver_opts()


class L3LoggingExtensionBase(object):
    """Base class for l3 logging extension like

    SNATLogExtension, FWaaSV2LogExtension
    """

    SUPPORTED_RESOURCE_TYPES = [resources.LOGGING_RESOURCE]

    def consume_api(self, agent_api):
        self.agent_api = agent_api

    def _load_driver_cls(self, namesapce, driver_name):
        return manager.NeutronManager.load_class_for_provider(