mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-07-29 23:58:23 -05:00
pylint: fix inconsistent-return-statements
pylint 2.7.0 now emits inconsistent-return-statements if one of try/except statement is not returning explicitly while the other do. Fixes: https://pagure.io/freeipa/issue/8720 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
committed by
Rob Crittenden
parent
4d87982b07
commit
178dec8fc3
@@ -571,6 +571,7 @@ class _TransportCertCache:
|
|||||||
raise
|
raise
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.warning("Failed to load %s", filename, exc_info=True)
|
logger.warning("Failed to load %s", filename, exc_info=True)
|
||||||
|
return None
|
||||||
|
|
||||||
def store_cert(self, domain, transport_cert):
|
def store_cert(self, domain, transport_cert):
|
||||||
"""Store a new cert or override existing cert
|
"""Store a new cert or override existing cert
|
||||||
@@ -677,6 +678,7 @@ class ModVaultData(Local):
|
|||||||
_transport_cert_cache.remove_cert(self.api.env.domain)
|
_transport_cert_cache.remove_cert(self.api.env.domain)
|
||||||
if raise_unexpected:
|
if raise_unexpected:
|
||||||
raise
|
raise
|
||||||
|
return None
|
||||||
|
|
||||||
def internal(self, algo, *args, **options):
|
def internal(self, algo, *args, **options):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -684,6 +684,9 @@ class KerbTransport(SSLTransport):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# pylint: disable=inconsistent-return-statements
|
||||||
|
# pylint does not properly manage the _handle_exception call
|
||||||
|
# that is always raising an exception
|
||||||
def single_request(self, host, handler, request_body, verbose=0):
|
def single_request(self, host, handler, request_body, verbose=0):
|
||||||
# Based on Python 2.7's xmllib.Transport.single_request
|
# Based on Python 2.7's xmllib.Transport.single_request
|
||||||
try:
|
try:
|
||||||
@@ -745,6 +748,7 @@ class KerbTransport(SSLTransport):
|
|||||||
logger.debug("HTTP connection destroyed (%s)",
|
logger.debug("HTTP connection destroyed (%s)",
|
||||||
host, exc_info=True)
|
host, exc_info=True)
|
||||||
raise
|
raise
|
||||||
|
# pylint: enable=inconsistent-return-statements
|
||||||
|
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
def __send_request(self, connection, host, handler, request_body, debug):
|
def __send_request(self, connection, host, handler, request_body, debug):
|
||||||
|
|||||||
Reference in New Issue
Block a user