diff --git a/src/DIRAC/Core/DISET/ThreadConfig.py b/src/DIRAC/Core/DISET/ThreadConfig.py index a42dac9bf3e..8961b508518 100644 --- a/src/DIRAC/Core/DISET/ThreadConfig.py +++ b/src/DIRAC/Core/DISET/ThreadConfig.py @@ -131,7 +131,7 @@ def wrapper(*args, **kwargs): :return: wrapped method """ - deco = tc.getDecorator() + deco = tc.getDecorator() # pylint: disable=no-member if not deco: return method(*args, **kwargs) # Deco is a decorator sooo.... diff --git a/src/DIRAC/Core/DISET/private/BaseClient.py b/src/DIRAC/Core/DISET/private/BaseClient.py index 2a4fc3aa956..41c965517b7 100755 --- a/src/DIRAC/Core/DISET/private/BaseClient.py +++ b/src/DIRAC/Core/DISET/private/BaseClient.py @@ -1,6 +1,7 @@ -""" This module exposes the BaseClient class, - which serves as base for InnerRPCClient and TransferClient. +"""This module exposes the BaseClient class, +which serves as base for InnerRPCClient and TransferClient. """ + import time import _thread @@ -130,7 +131,7 @@ def __discoverSetup(self): if self.KW_SETUP in self.kwargs and self.kwargs[self.KW_SETUP]: self.setup = str(self.kwargs[self.KW_SETUP]) else: - self.setup = self.__threadConfig.getSetup() + self.setup = self.__threadConfig.getSetup() # pylint: disable=no-member if not self.setup: self.setup = gConfig.getValue("/DIRAC/Setup", "Test") return S_OK() @@ -258,8 +259,10 @@ def __discoverExtraCredentials(self): self.__extraCredentials = self.kwargs[self.KW_EXTRA_CREDENTIALS] # Are we delegating something? - delegatedDN = self.kwargs.get(self.KW_DELEGATED_DN) or self.__threadConfig.getDN() - delegatedGroup = self.kwargs.get(self.KW_DELEGATED_GROUP) or self.__threadConfig.getGroup() + delegatedDN = self.kwargs.get(self.KW_DELEGATED_DN) or self.__threadConfig.getDN() # pylint: disable=no-member + delegatedGroup = ( + self.kwargs.get(self.KW_DELEGATED_GROUP) or self.__threadConfig.getGroup() # pylint: disable=no-member + ) if delegatedDN: self.kwargs[self.KW_DELEGATED_DN] = delegatedDN if not delegatedGroup: diff --git a/src/DIRAC/Core/Tornado/Client/private/TornadoBaseClient.py b/src/DIRAC/Core/Tornado/Client/private/TornadoBaseClient.py index ef4ea30fb2f..5199509e717 100644 --- a/src/DIRAC/Core/Tornado/Client/private/TornadoBaseClient.py +++ b/src/DIRAC/Core/Tornado/Client/private/TornadoBaseClient.py @@ -142,7 +142,7 @@ def __discoverSetup(self): if self.KW_SETUP in self.kwargs and self.kwargs[self.KW_SETUP]: self.setup = str(self.kwargs[self.KW_SETUP]) else: - self.setup = self.__threadConfig.getSetup() + self.setup = self.__threadConfig.getSetup() # pylint: disable=no-member if not self.setup: self.setup = gConfig.getValue("/DIRAC/Setup", "Test") return S_OK() @@ -284,7 +284,7 @@ def __discoverExtraCredentials(self): if self.KW_EXTRA_CREDENTIALS in self.kwargs: self.__extraCredentials = self.kwargs[self.KW_EXTRA_CREDENTIALS] # Are we delegating something? - delegatedDN, delegatedGroup = self.__threadConfig.getID() + delegatedDN, delegatedGroup = self.__threadConfig.getID() # pylint: disable=no-member if self.KW_DELEGATED_DN in self.kwargs and self.kwargs[self.KW_DELEGATED_DN]: delegatedDN = self.kwargs[self.KW_DELEGATED_DN] elif delegatedDN: diff --git a/src/DIRAC/DataManagementSystem/Service/S3GatewayHandler.py b/src/DIRAC/DataManagementSystem/Service/S3GatewayHandler.py index bfbf7e28a7a..fde22548d77 100644 --- a/src/DIRAC/DataManagementSystem/Service/S3GatewayHandler.py +++ b/src/DIRAC/DataManagementSystem/Service/S3GatewayHandler.py @@ -116,8 +116,8 @@ def export_createPresignedUrl(self, storageName, s3_method, urls, expiration): # If we can't obtain remote credentials, consider it permission denied return S_ERROR(errno.EACCES, "Could not obtain remote credentials") - self._tc.setDN(credDict["DN"]) - self._tc.setGroup(credDict["group"]) + self._tc.setDN(credDict["DN"]) # pylint: disable=no-member + self._tc.setGroup(credDict["group"]) # pylint: disable=no-member successful = {} failed = {} diff --git a/src/DIRAC/FrameworkSystem/private/authorization/AuthServer.py b/src/DIRAC/FrameworkSystem/private/authorization/AuthServer.py index 02824ca377d..33145d62c48 100644 --- a/src/DIRAC/FrameworkSystem/private/authorization/AuthServer.py +++ b/src/DIRAC/FrameworkSystem/private/authorization/AuthServer.py @@ -397,7 +397,7 @@ def create_authorization_response(self, response, username): """ try: response = super().create_authorization_response(response, username) - response.clear_cookie("auth_session") + response.clear_cookie("auth_session") # pylint: disable=no-member return response except Exception as e: sLog.exception(e) diff --git a/src/DIRAC/Resources/Catalog/ConditionPlugins/ProxyPlugin.py b/src/DIRAC/Resources/Catalog/ConditionPlugins/ProxyPlugin.py index c320f47855a..967de9b61ba 100644 --- a/src/DIRAC/Resources/Catalog/ConditionPlugins/ProxyPlugin.py +++ b/src/DIRAC/Resources/Catalog/ConditionPlugins/ProxyPlugin.py @@ -60,8 +60,8 @@ def __init__(self, conditions): # We may not have a proxy, check the thread local if not self.proxyInfo: tc = ThreadConfig() - userDN = tc.getDN() - userGroup = tc.getGroup() + userDN = tc.getDN() # pylint: disable=no-member + userGroup = tc.getGroup() # pylint: disable=no-member if userDN and userGroup: userName = Registry.getUsernameForDN(userDN).get("Value") if userName: diff --git a/src/DIRAC/__init__.py b/src/DIRAC/__init__.py index f4dbd83a241..da398d8c8da 100755 --- a/src/DIRAC/__init__.py +++ b/src/DIRAC/__init__.py @@ -60,7 +60,7 @@ import sys import warnings from pkgutil import extend_path -from typing import Any, Optional, Union +from typing import Any, NoReturn, Optional, Union __path__ = extend_path(__path__, __name__) @@ -298,7 +298,7 @@ def siteName(): from DIRAC.Core.Utilities.Platform import getPlatformString, getPlatform, getPlatformTuple -def exit(exitCode=0): +def exit(exitCode=0) -> NoReturn: """ Finish execution using callbacks """