import base64
import paramiko
import os
+import logging
+
from ..config import config
+from ..contextutil import safe_while
+
+log = logging.getLogger(__name__)
def split_user(user_at_host):
if opt_name in opts:
connect_args[arg_name] = opts[opt_name]
+ log.info(connect_args)
+
# just let the exceptions bubble up to caller
- ssh.connect(**connect_args)
+ with safe_while(sleep=1, action='connect to ' + host) as proceed:
+ while proceed():
+ try:
+ ssh.connect(**connect_args)
+ break
+ except paramiko.AuthenticationException:
+ log.exception("Error connecting to {host}".format(host=host))
ssh.get_transport().set_keepalive(keep_alive)
return ssh
-from teuthology import config
-
import fudge
+from teuthology import config
from .util import assert_raises
-
from .. import connection
class TestConnection(object):
+ def setup(self):
+ import time
+ time.sleep = lambda s: True
+
def clear_config(self):
config.config.teuthology_yaml = ''
config.config.load_files()