From 533a5b2633e8b5d9049256ea085324cbc45c6e73 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 26 Nov 2018 10:53:40 +0100 Subject: [PATCH] pylint 2.2: Fix unnecessary pass statement pylint 2.2.0 has a new checker for unnecessary pass statements. There is no need to have a pass statement in functions or classes with a doc string. Fixes: https://pagure.io/freeipa/issue/7772 Signed-off-by: Christian Heimes Reviewed-By: Thomas Woerner --- ipaclient/plugins/rpcclient.py | 4 ++-- ipalib/plugable.py | 1 - ipaplatform/base/tasks.py | 1 - ipaplatform/redhat/authconfig.py | 2 -- ipapython/admintool.py | 1 - ipapython/certdb.py | 3 --- ipaserver/dcerpc.py | 1 - ipaserver/install/adtrustinstance.py | 1 - ipaserver/p11helper.py | 5 +---- ipaserver/servroles.py | 2 -- ipatests/pytest_ipa/integration/tasks.py | 1 - ipatests/test_integration/test_installation.py | 1 - ipatests/test_xmlrpc/tracker/base.py | 1 - 13 files changed, 3 insertions(+), 21 deletions(-) diff --git a/ipaclient/plugins/rpcclient.py b/ipaclient/plugins/rpcclient.py index af2bc38d4..d3cb21504 100644 --- a/ipaclient/plugins/rpcclient.py +++ b/ipaclient/plugins/rpcclient.py @@ -39,14 +39,14 @@ if 'in_server' in api.env and api.env.in_server is False: class rpcclient(xmlclient): """xmlclient renamed to 'rpcclient'""" - pass + register()(rpcclient) elif api.env.rpc_protocol == 'jsonrpc': class rpcclient(jsonclient): """jsonclient renamed to 'rpcclient'""" - pass + register()(rpcclient) else: diff --git a/ipalib/plugable.py b/ipalib/plugable.py index e3f5ee240..5bb002ea4 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -230,7 +230,6 @@ class Plugin(ReadOnly): This method is called from `finalize()`. Subclasses can override this method in order to add custom finalization. """ - pass def ensure_finalized(self): """ diff --git a/ipaplatform/base/tasks.py b/ipaplatform/base/tasks.py index 5bb0fbd72..a5e59ef2e 100644 --- a/ipaplatform/base/tasks.py +++ b/ipaplatform/base/tasks.py @@ -177,7 +177,6 @@ class BaseTaskNamespace: """ Migrate pam stack configuration to authselect. """ - pass def set_selinux_booleans(self, required_settings, backup_func=None): """Set the specified SELinux booleans diff --git a/ipaplatform/redhat/authconfig.py b/ipaplatform/redhat/authconfig.py index a386dc71b..a51234520 100644 --- a/ipaplatform/redhat/authconfig.py +++ b/ipaplatform/redhat/authconfig.py @@ -56,7 +56,6 @@ class RedHatAuthToolBase: Backup the system authentication resources configuration :param path: directory where the backup will be stored """ - pass @abc.abstractmethod def restore(self, path): @@ -64,7 +63,6 @@ class RedHatAuthToolBase: Restore the system authentication resources configuration from a backup :param path: directory where the backup is stored """ - pass @abc.abstractmethod def set_nisdomain(self, nisdomain): diff --git a/ipapython/admintool.py b/ipapython/admintool.py index 6ba682ef8..1bb953f4f 100644 --- a/ipapython/admintool.py +++ b/ipapython/admintool.py @@ -212,7 +212,6 @@ class AdminTool: Any options that might be asked for should also be validated here. """ - pass def setup_logging(self, log_file_mode='w'): """Set up logging diff --git a/ipapython/certdb.py b/ipapython/certdb.py index 12e21f286..3a38b2fea 100644 --- a/ipapython/certdb.py +++ b/ipapython/certdb.py @@ -224,19 +224,16 @@ KEY_RE = re.compile( class Pkcs12ImportIncorrectPasswordError(RuntimeError): """ Raised when import_pkcs12 fails because of a wrong password. """ - pass class Pkcs12ImportOpenError(RuntimeError): """ Raised when import_pkcs12 fails trying to open the file. """ - pass class Pkcs12ImportUnknownError(RuntimeError): """ Raised when import_pkcs12 fails because of an unknown error. """ - pass class NSSDatabase: diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py index c349a7b14..5e841350b 100644 --- a/ipaserver/dcerpc.py +++ b/ipaserver/dcerpc.py @@ -157,7 +157,6 @@ class TrustTopologyConflictSolved(Exception): No separate errno is assigned as this error should not be visible outside the dcerpc.py code. """ - pass def assess_dcerpc_error(error): diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py index 67317ee73..a21be5fba 100644 --- a/ipaserver/install/adtrustinstance.py +++ b/ipaserver/install/adtrustinstance.py @@ -563,7 +563,6 @@ class ADTRUSTInstance(service.Service): """ Do not re-set ownership of samba keytab """ - pass def clean_samba_keytab(self): if os.path.exists(self.keytab): diff --git a/ipaserver/p11helper.py b/ipaserver/p11helper.py index ca467614e..f7628b788 100644 --- a/ipaserver/p11helper.py +++ b/ipaserver/p11helper.py @@ -521,23 +521,20 @@ CONST_RSA_PKCS_OAEP_PARAMS_ptr = new_ptr(CK_RSA_PKCS_OAEP_PARAMS, dict( # class P11HelperException(Exception): """parent class for all exceptions""" - pass + P11HelperException.__name__ = 'Exception' class Error(P11HelperException): """general error""" - pass class NotFound(P11HelperException): """key not found""" - pass class DuplicationError(P11HelperException): """key already exists""" - pass ######################################################################## diff --git a/ipaserver/servroles.py b/ipaserver/servroles.py index 6f3ba54bc..34048d2c9 100644 --- a/ipaserver/servroles.py +++ b/ipaserver/servroles.py @@ -139,7 +139,6 @@ class BaseServerRole(LDAPBasedProperty): filter and search base matching only the status on this server :returns: tuple of search base (a DN) and search filter """ - pass @abc.abstractmethod def get_result_from_entries(self, entries): @@ -150,7 +149,6 @@ class BaseServerRole(LDAPBasedProperty): :returns: list of dicts generated by `create_role_status_dict()` method """ - pass def _fill_in_absent_masters(self, ldap2, api_instance, result): """ diff --git a/ipatests/pytest_ipa/integration/tasks.py b/ipatests/pytest_ipa/integration/tasks.py index 90da8fa62..f79348e30 100644 --- a/ipatests/pytest_ipa/integration/tasks.py +++ b/ipatests/pytest_ipa/integration/tasks.py @@ -525,7 +525,6 @@ def configure_dns_for_trust(master, ad): configuration on IPA master according to the relationship of the IPA's and AD's domains. """ - pass def establish_trust_with_ad(master, ad_domain, extra_args=()): diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py index 768c22abe..2150e3b24 100644 --- a/ipatests/test_integration/test_installation.py +++ b/ipatests/test_integration/test_installation.py @@ -352,7 +352,6 @@ class TestADTrustInstall(ADTrustInstallTestBase): class for more details) against plain IPA master (no DNS, no KRA, no AD trust) """ - pass class TestADTrustInstallWithDNS_KRA_ADTrust(ADTrustInstallTestBase): diff --git a/ipatests/test_xmlrpc/tracker/base.py b/ipatests/test_xmlrpc/tracker/base.py index aec85befc..d5de41c5b 100644 --- a/ipatests/test_xmlrpc/tracker/base.py +++ b/ipatests/test_xmlrpc/tracker/base.py @@ -392,4 +392,3 @@ class Tracker(RetrievalTracker, SearchTracker, ModificationTracker, A missing method will cause a NotImplementedError during runtime as a result. """ - pass