From: Kyr Shatskyy Date: Thu, 14 May 2020 14:37:11 +0000 (+0200) Subject: Revert "teuthology/orchestra/connection: add retry exceptions" X-Git-Tag: 1.1.0~112^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1478%2Fhead;p=teuthology.git Revert "teuthology/orchestra/connection: add retry exceptions" This reverts commit 1e30d6f624921ae98c27981d55e06c29d1b0fdd0. --- diff --git a/teuthology/orchestra/connection.py b/teuthology/orchestra/connection.py index 0e5ce88b1..20a3b8fb2 100644 --- a/teuthology/orchestra/connection.py +++ b/teuthology/orchestra/connection.py @@ -4,23 +4,13 @@ Connection utilities import base64 import paramiko import os -import socket import logging -from paramiko import AuthenticationException -from paramiko.ssh_exception import NoValidConnectionsError - from teuthology.config import config from teuthology.contextutil import safe_while log = logging.getLogger(__name__) -RECONNECT_EXCEPTIONS = ( - socket.error, - AuthenticationException, - NoValidConnectionsError, -) - def split_user(user_at_host): """ @@ -117,14 +107,8 @@ def connect(user_at_host, host_key=None, keep_alive=False, timeout=60, try: ssh.connect(**connect_args) break - except RECONNECT_EXCEPTIONS as e: - log.debug("Error connecting to {host}: {e}".format(host=host,e=e)) - except Exception as e: - # gevent.__hub_primitives returns a generic Exception, *sigh* - if "timed out" in str(e): - log.debug("Error connecting to {host}: {e}".format(host=host,e=e)) - else: - raise - + except paramiko.AuthenticationException: + log.exception( + "Error connecting to {host}".format(host=host)) ssh.get_transport().set_keepalive(keep_alive) return ssh