]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
unlock machines and report status if reimaging error
authorShraddha Agrawal <shraddha.agrawal000@gmail.com>
Fri, 21 Aug 2020 11:58:33 +0000 (17:28 +0530)
committerJosh Durgin <jdurgin@redhat.com>
Sat, 16 Jan 2021 21:36:26 +0000 (16:36 -0500)
Signed-off-by: Shraddha Agrawal <shraddha.agrawal000@gmail.com>
teuthology/dispatcher/supervisor.py

index 89233014d698afcc12744fd2cf91cc813e07662d..137754b3188ed4a600fc8d66245f97669b471689 100644 (file)
@@ -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'))