Skip to content

Commit

Permalink
fix(client): handle timeout error
Browse files Browse the repository at this point in the history
  • Loading branch information
gquittet committed Jun 12, 2022
1 parent 0f3beef commit 45c801f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions paramiko/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
SSH client & key policies
"""

from binascii import hexlify
import getpass
import inspect
import os
import socket
import warnings
from errno import ECONNREFUSED, EHOSTUNREACH
from binascii import hexlify
from errno import ECONNREFUSED, EHOSTUNREACH, ETIMEDOUT

from paramiko.agent import Agent
from paramiko.common import DEBUG
Expand All @@ -38,12 +38,12 @@
from paramiko.py3compat import string_types
from paramiko.rsakey import RSAKey
from paramiko.ssh_exception import (
SSHException,
BadHostKeyException,
NoValidConnectionsError,
SSHException,
)
from paramiko.transport import Transport
from paramiko.util import retry_on_signal, ClosingContextManager
from paramiko.util import ClosingContextManager, retry_on_signal


class SSHClient(ClosingContextManager):
Expand Down Expand Up @@ -356,7 +356,7 @@ def connect(
sock.close()
# Raise anything that isn't a straight up connection error
# (such as a resolution error)
if e.errno not in (ECONNREFUSED, EHOSTUNREACH):
if e.errno not in (ECONNREFUSED, EHOSTUNREACH, ETIMEDOUT):
raise
# Capture anything else so we know how the run looks once
# iteration is complete. Retain info about which attempt
Expand Down

0 comments on commit 45c801f

Please sign in to comment.