pylint: remove unneeded disable=unused-private-member

pylint fixed issue https://github.com/PyCQA/pylint/issues/4756
and we don't need anymore to disable this check.

Related: https://pagure.io/freeipa/issue/9278
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Stanislav Levin <slev@altlinux.org>
This commit is contained in:
Florence Blanc-Renaud 2022-11-18 16:37:20 +01:00
parent 232b5a9dde
commit cad06382a2
11 changed files with 28 additions and 28 deletions

View File

@ -126,25 +126,25 @@ class CommandOverride(Command):
return api.get_plugin_next(cls)
@classmethod
def __doc_getter(cls): # pylint: disable=unused-private-member, #4756
def __doc_getter(cls):
return cls.__get_next().doc
doc = classproperty(__doc_getter)
@classmethod
def __summary_getter(cls): # pylint: disable=unused-private-member, #4756
def __summary_getter(cls):
return cls.__get_next().summary
summary = classproperty(__summary_getter)
@classmethod
def __NO_CLI_getter(cls): # pylint: disable=unused-private-member, #4756
def __NO_CLI_getter(cls):
return cls.__get_next().NO_CLI
NO_CLI = classproperty(__NO_CLI_getter)
@classmethod
def __topic_getter(cls): # pylint: disable=unused-private-member, #4756
def __topic_getter(cls):
return cls.__get_next().topic
topic = classproperty(__topic_getter)

View File

@ -54,7 +54,7 @@ class _fake_automountlocation_show(Method):
@register(override=True, no_fail=True)
class automountlocation_tofiles(MethodOverride):
@classmethod
def __NO_CLI_getter(cls): # pylint: disable=unused-private-member, #4756
def __NO_CLI_getter(cls):
return (api.Command.get_plugin('automountlocation_show') is
_fake_automountlocation_show)

View File

@ -81,7 +81,7 @@ class otptoken_add_yubikey(Command):
has_output_params = takes_options
@classmethod
def __NO_CLI_getter(cls): # pylint: disable=unused-private-member, #4756
def __NO_CLI_getter(cls):
return api.Command.get_plugin('otptoken_add') is _fake_otptoken_add
NO_CLI = classproperty(__NO_CLI_getter)

View File

@ -200,7 +200,7 @@ class vault_add(Local):
)
@classmethod
def __NO_CLI_getter(cls): # pylint: disable=unused-private-member, #4756
def __NO_CLI_getter(cls):
return (api.Command.get_plugin('vault_add_internal') is
_fake_vault_add_internal)
@ -411,7 +411,7 @@ class vault_mod(Local):
)
@classmethod
def __NO_CLI_getter(cls): # pylint: disable=unused-private-member, #4756
def __NO_CLI_getter(cls):
return (api.Command.get_plugin('vault_mod_internal') is
_fake_vault_mod_internal)
@ -780,7 +780,7 @@ class vault_archive(ModVaultData):
)
@classmethod
def __NO_CLI_getter(cls): # pylint: disable=unused-private-member, #4756
def __NO_CLI_getter(cls):
return (api.Command.get_plugin('vault_archive_internal') is
_fake_vault_archive_internal)
@ -1036,7 +1036,7 @@ class vault_retrieve(ModVaultData):
)
@classmethod
def __NO_CLI_getter(cls): # pylint: disable=unused-private-member, #4756
def __NO_CLI_getter(cls):
return (api.Command.get_plugin('vault_retrieve_internal') is
_fake_vault_retrieve_internal)

View File

@ -96,7 +96,7 @@ class Connectible(Backend):
"""
return hasattr(context, self.id)
def __get_conn(self): # pylint: disable=unused-private-member, #4756
def __get_conn(self):
"""
Return thread-local connection.
"""

View File

@ -429,7 +429,7 @@ class Command(HasParam):
api_version = API_VERSION
@classmethod
def __topic_getter(cls): # pylint: disable=unused-private-member, #4756
def __topic_getter(cls):
return cls.__module__.rpartition('.')[2]
topic = classproperty(__topic_getter)

View File

@ -140,32 +140,32 @@ class Plugin(ReadOnly):
self.__finalize_lock = threading.RLock()
@classmethod
def __name_getter(cls): # pylint: disable=unused-private-member, #4756
def __name_getter(cls):
return cls.__name__
# you know nothing, pylint
name = classproperty(__name_getter)
@classmethod
def __full_name_getter(cls): # pylint: disable=unused-private-member
def __full_name_getter(cls):
return '{}/{}'.format(cls.name, cls.version)
full_name = classproperty(__full_name_getter)
@classmethod
def __bases_getter(cls): # pylint: disable=unused-private-member, #4756
def __bases_getter(cls):
return cls.__bases__
bases = classproperty(__bases_getter)
@classmethod
def __doc_getter(cls): # pylint: disable=unused-private-member, #4756
def __doc_getter(cls):
return cls.__doc__
doc = classproperty(__doc_getter)
@classmethod
def __summary_getter(cls): # pylint: disable=unused-private-member, #4756
def __summary_getter(cls):
doc = cls.doc
if not _(doc).msg:
return '<%s.%s>' % (cls.__module__, cls.__name__)

View File

@ -80,7 +80,7 @@ class DummyCommand:
def __init__(self, name):
self.__name = name
def __get_name(self): # pylint: disable=unused-private-member, #4756
def __get_name(self):
return self.__name
name = property(__get_name)
@ -89,7 +89,7 @@ class DummyAPI:
def __init__(self, cnt):
self.__cmd = plugable.APINameSpace(self.__cmd_iter(cnt), DummyCommand)
def __get_cmd(self): # pylint: disable=unused-private-member, #4756
def __get_cmd(self):
return self.__cmd
Command = property(__get_cmd)

View File

@ -45,7 +45,7 @@ class PrivateExceptionTester:
_klass = None
__klass = None
def __get_klass(self): # pylint: disable=unused-private-member, #4756
def __get_klass(self):
if self.__klass is None:
self.__klass = self._klass
assert issubclass(self.__klass, Exception)
@ -199,7 +199,7 @@ class PublicExceptionTester:
_klass = None
__klass = None
def __get_klass(self): # pylint: disable=unused-private-member, #4756
def __get_klass(self):
if self.__klass is None:
self.__klass = self._klass
assert issubclass(self.__klass, Exception)

View File

@ -41,17 +41,17 @@ class Prop:
self.__ops = frozenset(ops)
self.__prop = 'prop value'
def __get_prop(self): # pylint: disable=unused-private-member, #4756
def __get_prop(self):
if 'get' not in self.__ops:
raise AttributeError('get prop')
return self.__prop
def __set_prop(self, value): # pylint: disable=unused-private-member, #4756
def __set_prop(self, value):
if 'set' not in self.__ops:
raise AttributeError('set prop')
self.__prop = value
def __del_prop(self): # pylint: disable=unused-private-member, #4756
def __del_prop(self):
if 'del' not in self.__ops:
raise AttributeError('del prop')
self.__prop = None

View File

@ -94,7 +94,7 @@ class TempDir:
self.__path = tempfile.mkdtemp(prefix='ipa.tests.')
assert self.path == self.__path
def __get_path(self): # pylint: disable=unused-private-member, pylint#4756
def __get_path(self):
assert path.abspath(self.__path) == self.__path
assert self.__path.startswith(path.join(tempfile.gettempdir(),
'ipa.tests.'))
@ -516,14 +516,14 @@ class ClassChecker:
__cls = None
__subcls = None
def __get_cls(self): # pylint: disable=unused-private-member, #4756
def __get_cls(self):
if self.__cls is None:
self.__cls = self._cls # pylint: disable=E1101
assert inspect.isclass(self.__cls)
return self.__cls
cls = property(__get_cls)
def __get_subcls(self): # pylint: disable=unused-private-member, #4756
def __get_subcls(self):
if self.__subcls is None:
self.__subcls = self.get_subcls()
assert inspect.isclass(self.__subcls)
@ -576,7 +576,7 @@ def create_test_api(**kw):
class PluginTester:
__plugin = None
def __get_plugin(self): # pylint: disable=unused-private-member, #4756
def __get_plugin(self):
if self.__plugin is None:
self.__plugin = self._plugin # pylint: disable=E1101
assert issubclass(self.__plugin, Plugin)