From: Zack Cerza Date: Thu, 19 Mar 2015 20:58:26 +0000 (-0600) Subject: Tweak ssh-keyscan timing X-Git-Tag: 1.1.0~985^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F453%2Fhead;p=teuthology.git 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 --- diff --git a/teuthology/lock.py b/teuthology/lock.py index 82a176e06..a11e6f93e 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,