ignored protected-access for _unpack()

This commit is contained in:
Devaev Maxim 2020-09-30 07:25:52 +03:00
parent 3f9c32e9fc
commit 630593492a
7 changed files with 7 additions and 8 deletions

View File

@ -41,7 +41,6 @@ def main(argv: Optional[List[str]]=None) -> None:
argv=argv, argv=argv,
)[2].ipmi )[2].ipmi
# pylint: disable=protected-access
IpmiServer( IpmiServer(
auth_manager=IpmiAuthManager(**config.auth._unpack()), auth_manager=IpmiAuthManager(**config.auth._unpack()),
kvmd=KvmdClient( kvmd=KvmdClient(

View File

@ -43,8 +43,6 @@ from .server import KvmdServer
# ===== # =====
def main(argv: Optional[List[str]]=None) -> None: def main(argv: Optional[List[str]]=None) -> None:
# pylint: disable=protected-access
config = init( config = init(
prog="kvmd", prog="kvmd",
description="The main Pi-KVM daemon", description="The main Pi-KVM daemon",

View File

@ -44,7 +44,6 @@ def main(argv: Optional[List[str]]=None) -> None:
user_agent = htclient.make_user_agent("KVMD-VNC") user_agent = htclient.make_user_agent("KVMD-VNC")
# pylint: disable=protected-access
VncServer( VncServer(
host=config.server.host, host=config.server.host,
port=config.server.port, port=config.server.port,

View File

@ -80,7 +80,7 @@ class Section(dict):
for (key, value) in self.items(): for (key, value) in self.items():
if key not in ignore: if key not in ignore:
if isinstance(value, Section): if isinstance(value, Section):
unpacked[key] = value._unpack() # pylint: disable=protected-access unpacked[key] = value._unpack()
else: # Option else: # Option
unpacked[self._get_unpack_as(key)] = value # pylint: disable=protected-access unpacked[self._get_unpack_as(key)] = value # pylint: disable=protected-access
return unpacked return unpacked

View File

@ -33,7 +33,10 @@ disable =
no-else-return, no-else-return,
len-as-condition, len-as-condition,
raise-missing-from, raise-missing-from,
protected-access,
[CLASSES]
exclude-protected =
_unpack,
[REPORTS] [REPORTS]
msg-template = {symbol} -- {path}:{line}({obj}): {msg} msg-template = {symbol} -- {path}:{line}({obj}): {msg}

View File

@ -43,7 +43,7 @@ from kvmd.plugins.auth import get_auth_service_class
def _make_service_kwargs(path: str) -> Dict: def _make_service_kwargs(path: str) -> Dict:
cls = get_auth_service_class("htpasswd") cls = get_auth_service_class("htpasswd")
scheme = cls.get_plugin_options() scheme = cls.get_plugin_options()
return make_config({"file": path}, scheme)._unpack() # pylint: disable=protected-access return make_config({"file": path}, scheme)._unpack()
@contextlib.asynccontextmanager @contextlib.asynccontextmanager

View File

@ -36,7 +36,7 @@ from kvmd.plugins.auth import get_auth_service_class
async def get_configured_auth_service(name: str, **kwargs: Any) -> AsyncGenerator[BaseAuthService, None]: async def get_configured_auth_service(name: str, **kwargs: Any) -> AsyncGenerator[BaseAuthService, None]:
service_class = get_auth_service_class(name) service_class = get_auth_service_class(name)
config = make_config(kwargs, service_class.get_plugin_options()) config = make_config(kwargs, service_class.get_plugin_options())
service = service_class(**config._unpack()) # pylint: disable=protected-access service = service_class(**config._unpack())
try: try:
yield service yield service
finally: finally: