From 68262dc5f136542d4d5b05f35a541bde0393fa57 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 19 Mar 2015 14:58:26 -0600 Subject: [PATCH] Tweak ssh-keyscan timing Make the call itself timeout after 1s instead of 5s. Make update_lock() try 15 times, sleeping for 1s between attempts. A full timeout of update_lock() should take ~30s. Signed-off-by: Zack Cerza --- teuthology/lock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teuthology/lock.py b/teuthology/lock.py index 82a176e064..a11e6f93e6 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -544,7 +544,7 @@ def update_lock(name, description=None, status=None, ssh_pub_key=None): if not status: status_info = get_status(name) if status_info['is_vm']: - with safe_while(sleep=10, tries=3, _raise=False, + with safe_while(sleep=1, tries=15, _raise=False, action='ssh-keyscan') as proceed: while proceed(): ssh_key = ssh_keyscan([name]) @@ -606,7 +606,7 @@ def ssh_keyscan(hostnames): raise TypeError("'hostnames' must be a list") hostnames = [misc.canonicalize_hostname(name, user=None) for name in hostnames] - args = ['ssh-keyscan', '-t', 'rsa'] + hostnames + args = ['ssh-keyscan', '-T', '1', '-t', 'rsa'] + hostnames p = subprocess.Popen( args=args, stdout=subprocess.PIPE, -- 2.39.5