diff --git a/tobiko/http/_session.py b/tobiko/http/_session.py index 8447d2205..6319b6d80 100644 --- a/tobiko/http/_session.py +++ b/tobiko/http/_session.py @@ -42,7 +42,9 @@ def setup_http_session(session, ssh_client=None): # All known keyword arguments that could be provided to the pool manager, its # pools, or the underlying connections. This is used to construct a pool key. -_key_fields = tuple(poolmanager._key_fields) + ('key_ssh_client',) +_key_fields = tuple( + poolmanager._key_fields # type: ignore +) + ('key_ssh_client',) class PoolKey(collections.namedtuple("PoolKey", _key_fields)): # type: ignore @@ -57,10 +59,12 @@ class PoolKey(collections.namedtuple("PoolKey", _key_fields)): # type: ignore #: Each PoolManager makes a copy of this dictionary so they can be configured #: globally here, or individually on the instance. key_fn_by_scheme = { - "http": functools.partial(poolmanager._default_key_normalizer, - PoolKey), - "https": functools.partial(poolmanager._default_key_normalizer, - PoolKey), + "http": functools.partial( + poolmanager._default_key_normalizer, # type: ignore + PoolKey), + "https": functools.partial( + poolmanager._default_key_normalizer, # type: ignore + PoolKey), } # pylint: enable=protected-access diff --git a/tobiko/shell/ssh/_client.py b/tobiko/shell/ssh/_client.py index fb07afbf9..39e8f78c4 100644 --- a/tobiko/shell/ssh/_client.py +++ b/tobiko/shell/ssh/_client.py @@ -578,13 +578,14 @@ def ssh_client(host, port=None, username=None, proxy_jump=None, **connect_parameters) -def load_private_keys(key_filenames: typing.List[str]): - pkeys = [] +def load_private_keys(key_filenames: typing.List[str]) \ + -> typing.List[paramiko.PKey]: + pkeys: typing.List[paramiko.PKey] = [] for filename in key_filenames: if os.path.exists(filename): try: with io.open(filename, 'rt') as fd: - pkey = paramiko.RSAKey.from_private_key(fd) + pkey: paramiko.PKey = paramiko.RSAKey.from_private_key(fd) except Exception: LOG.error('Unable to get RSAKey private key from file: ' f'{filename}', exc_info=1)