From: Shraddha Agrawal Date: Fri, 21 Aug 2020 11:58:33 +0000 (+0530) Subject: unlock machines and report status if reimaging error X-Git-Tag: 1.1.0~17^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=126c6bc17a945105d604165c19e3fd714eafed51;p=teuthology.git unlock machines and report status if reimaging error Signed-off-by: Shraddha Agrawal --- diff --git a/teuthology/dispatcher/supervisor.py b/teuthology/dispatcher/supervisor.py index 89233014d..137754b31 100644 --- a/teuthology/dispatcher/supervisor.py +++ b/teuthology/dispatcher/supervisor.py @@ -167,7 +167,14 @@ def reimage_machines(job_config): # change the status during the reimaging process report.try_push_job_info(ctx.config, dict(status='waiting')) targets = job_config['targets'] - reimaged = reimage_many(ctx, targets, job_config['machine_type']) + try: + reimaged = reimage_many(ctx, targets, job_config['machine_type']) + except Exception: + log.info('Reimaging error. Nuking machines...') + # Reimage failures should map to the 'dead' status instead of 'fail' + report.try_push_job_info(ctx.config, dict(status='dead')) + nuke(ctx, True) + raise ctx.config['targets'] = reimaged # change the status to running after the reimaging process report.try_push_job_info(ctx.config, dict(status='running'))