From 35fe967089ff9f4d5ede80d5eb616049a816cc9e Mon Sep 17 00:00:00 2001 From: Shraddha Agrawal Date: Fri, 21 Aug 2020 17:28:33 +0530 Subject: [PATCH] unlock machines and report status if reimaging error Signed-off-by: Shraddha Agrawal --- teuthology/dispatcher/supervisor.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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')) -- 2.47.3