Merge "mypy: Use tuple type for SUPPORTED_LOGGING_TYPES"
This commit is contained in:
commit
5c3f883a42
1
mypy.ini
1
mypy.ini
@ -79,7 +79,6 @@ exclude = (?x)(
|
||||
| ^neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py$
|
||||
| ^neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py$
|
||||
| ^neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py$
|
||||
| ^neutron/services/logapi/drivers/openvswitch/ovs_firewall_log.py$
|
||||
| ^neutron/tests/$
|
||||
)
|
||||
|
||||
|
@ -37,7 +37,7 @@ class LoggingDriver(object, metaclass=abc.ABCMeta):
|
||||
"""Defines abstract interface for logging driver"""
|
||||
|
||||
# specific logging types are supported
|
||||
SUPPORTED_LOGGING_TYPES = None
|
||||
SUPPORTED_LOGGING_TYPES = tuple()
|
||||
|
||||
@abc.abstractmethod
|
||||
def initialize(self, resource_rpc, **kwargs):
|
||||
|
@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
DRIVER = None
|
||||
|
||||
SUPPORTED_LOGGING_TYPES = ['security_group']
|
||||
SUPPORTED_LOGGING_TYPES = ('security_group',)
|
||||
|
||||
|
||||
class OVSDriver(base.DriverBase):
|
||||
|
@ -131,7 +131,7 @@ class OFPortLog(object):
|
||||
|
||||
class OVSFirewallLoggingDriver(log_ext.LoggingDriver):
|
||||
|
||||
SUPPORTED_LOGGING_TYPES = ['security_group']
|
||||
SUPPORTED_LOGGING_TYPES = ('security_group',)
|
||||
REQUIRED_PROTOCOLS = [
|
||||
ovs_consts.OPENFLOW13,
|
||||
ovs_consts.OPENFLOW14,
|
||||
|
@ -41,7 +41,7 @@ DRIVER = None
|
||||
log_cfg.register_log_driver_opts()
|
||||
|
||||
MAX_INT_LABEL = 2**32
|
||||
SUPPORTED_LOGGING_TYPES = [log_const.SECURITY_GROUP]
|
||||
SUPPORTED_LOGGING_TYPES = (log_const.SECURITY_GROUP,)
|
||||
|
||||
|
||||
class LoggingNotSupported(n_exceptions.NeutronException):
|
||||
|
@ -32,7 +32,7 @@ _uuid = uuidutils.generate_uuid
|
||||
|
||||
class FakeLogDriver(log_ext.LoggingDriver):
|
||||
|
||||
SUPPORTED_LOGGING_TYPES = ['fake_resource']
|
||||
SUPPORTED_LOGGING_TYPES = ('fake_resource',)
|
||||
|
||||
def initialize(self, resource_rpc, **kwargs):
|
||||
pass
|
||||
|
@ -33,7 +33,7 @@ from neutron.tests import base
|
||||
|
||||
class FakeLogDriver(log_ext.LoggingDriver):
|
||||
|
||||
SUPPORTED_LOGGING_TYPES = ['security_group']
|
||||
SUPPORTED_LOGGING_TYPES = ('security_group',)
|
||||
|
||||
def initialize(self, resource_rpc, **kwargs):
|
||||
pass
|
||||
|
@ -112,7 +112,7 @@ class TestOVSFirewallLoggingDriver(base.BaseTestCase):
|
||||
agent_rpc, 'LoggingApiStub', autospec=True).start()
|
||||
self.log_driver.start_logapp = mock.Mock()
|
||||
self.log_driver.initialize(resource_rpc_mock)
|
||||
self.log_driver.SUPPORTED_LOGGING_TYPES = ['security_group']
|
||||
self.log_driver.SUPPORTED_LOGGING_TYPES = ('security_group',)
|
||||
self.mock_bridge = self.log_driver.int_br
|
||||
self.mock_bridge.reset_mock()
|
||||
self.fake_ovs_port = FakeOVSPort('port', 1, '00:00:00:00:00:00')
|
||||
|
@ -18,7 +18,7 @@ from neutron_lib.api.definitions import portbindings
|
||||
from neutron.services.logapi.drivers import base as log_base_driver
|
||||
from neutron.tests import base
|
||||
|
||||
SUPPORTED_LOGGING_TYPES = ['security_group']
|
||||
SUPPORTED_LOGGING_TYPES = ('security_group',)
|
||||
|
||||
|
||||
class FakeDriver(log_base_driver.DriverBase):
|
||||
|
@ -30,7 +30,7 @@ from neutron.services.logapi.common import sg_validate
|
||||
from neutron.tests.unit.services.logapi import base
|
||||
|
||||
DB_PLUGIN_KLASS = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2'
|
||||
SUPPORTED_LOGGING_TYPES = ['security_group']
|
||||
SUPPORTED_LOGGING_TYPES = ('security_group',)
|
||||
|
||||
|
||||
class TestLoggingPlugin(base.BaseLogTestCase):
|
||||
|
Loading…
Reference in New Issue
Block a user