From 822edc31c8c3235e037605da3c083661f0d2b866 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Mon, 4 Nov 2024 13:14:04 -0500 Subject: [PATCH] Enable pylint useless-super-delegation check Change code to remove unneeded super() calls. In the case of the MaintenanceWorker class, the parent classes never implement anything for stop() or wait() so we can safely use 'pass'. They must exist since the oslo.service class defines them as abtract methods. TrivialFix Change-Id: Ic8b184f077b6647c735e01cf89211f1fc613cb85 --- .pylintrc | 1 - .../plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py | 3 --- .../ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py | 6 ------ neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/worker.py | 4 ++-- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.pylintrc b/.pylintrc index 41abde4674a..bb5be422736 100644 --- a/.pylintrc +++ b/.pylintrc @@ -47,7 +47,6 @@ disable= unused-argument, unused-import, unused-variable, - useless-super-delegation, unnecessary-pass, raise-missing-from, arguments-renamed, diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py index f253650b53e..0f759d1b562 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/commands.py @@ -103,9 +103,6 @@ def _add_gateway_chassis(api, txn, lrp_name, val): class CheckLivenessCommand(command.BaseCommand): - def __init__(self, api): - super().__init__(api) - def run_idl(self, txn): # txn.pre_commit responsible for updating nb_global.nb_cfg, but # python-ovs will not update nb_cfg if no other changes are made diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py index 0b441cf7c37..e5ed9d0f7f8 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py @@ -234,9 +234,6 @@ def get_ovn_idls(driver, trigger): class OvsdbNbOvnIdl(nb_impl_idl.OvnNbApiIdlImpl, Backend): - def __init__(self, connection): - super().__init__(connection) - @n_utils.classproperty def connection_string(cls): return cfg.get_ovn_nb_connection() @@ -913,9 +910,6 @@ class OvsdbNbOvnIdl(nb_impl_idl.OvnNbApiIdlImpl, Backend): class OvsdbSbOvnIdl(sb_impl_idl.OvnSbApiIdlImpl, Backend): - def __init__(self, connection): - super().__init__(connection) - @n_utils.classproperty def connection_string(cls): return cfg.get_ovn_sb_connection() diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/worker.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/worker.py index 613ce345058..f41d6c1a5fe 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/worker.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/worker.py @@ -31,11 +31,11 @@ class MaintenanceWorker(worker.BaseWorker): def stop(self): """Stop service.""" - super().stop() + pass def wait(self): """Wait for service to complete.""" - super().wait() + pass @staticmethod def reset():