Merge "mypy: Use tuple type for SUPPORTED_LOGGING_TYPES"

This commit is contained in:
Zuul 2024-10-04 08:55:12 +00:00 committed by Gerrit Code Review
commit 5c3f883a42
10 changed files with 9 additions and 10 deletions

View File

@ -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/$
)

View File

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

View File

@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__)
DRIVER = None
SUPPORTED_LOGGING_TYPES = ['security_group']
SUPPORTED_LOGGING_TYPES = ('security_group',)
class OVSDriver(base.DriverBase):

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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