From: Josh Durgin Date: Tue, 17 Jan 2012 23:35:19 +0000 (-0800) Subject: kernel: ignore connection problems while waiting for reboot X-Git-Tag: 1.1.0~2659 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=29885f3e42ff50261b7ca6dc819e7ae131d7b8be;p=teuthology.git kernel: ignore connection problems while waiting for reboot --- diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index b3a8574aa..c49950225 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -187,11 +187,14 @@ def wait_for_reboot(ctx, need_install, timeout): teuthology.reconnect(ctx, timeout) for client in need_install.keys(): log.info('Checking client {client} for new kernel version...'.format(client=client)) - if need_to_install(ctx, client, need_install[client]): - assert time.time() - starttime < timeout, \ - 'failed to install new kernel version within timeout' - else: + try: + assert not need_to_install(ctx, client, need_install[client]), \ + 'failed to install new kernel version within timeout' del need_install[client] + except: + # ignore connection resets and asserts while time is left + if time.time() - starttime > timeout: + raise time.sleep(1) def task(ctx, config):