]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Tweak ssh-keyscan timing 453/head
authorZack Cerza <zack@redhat.com>
Thu, 19 Mar 2015 20:58:26 +0000 (14:58 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 19 Mar 2015 20:58:26 +0000 (14:58 -0600)
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 <zack@redhat.com>
teuthology/lock.py

index 82a176e064326bc78252ed41dfd4898383ada0d6..a11e6f93e65a726b3c52546592593807a41edf42 100644 (file)
@@ -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,