]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
lock.ops.lock_many: Unlock on reimage failure
authorZack Cerza <zack@cerza.org>
Mon, 15 Sep 2025 17:25:39 +0000 (11:25 -0600)
committerDavid Galloway <david.galloway@ibm.com>
Mon, 12 Jan 2026 21:12:29 +0000 (16:12 -0500)
Signed-off-by: Zack Cerza <zack@cerza.org>
teuthology/lock/ops.py

index 968ab8641d0ec609fa4b87847953b22e0d24555d..f9662b44cfcff406d8c091ba1e4fa551796464ee 100644 (file)
@@ -143,7 +143,12 @@ def lock_many(ctx, num, machine_type, user=None, description=None,
                 update_nodes(ok_machs)
                 return ok_machs
             elif reimage and machine_type in reimage_types:
-                return reimage_machines(ctx, machines, machine_type)
+                try:
+                    return reimage_machines(ctx, machines, machine_type)
+                except Exception:
+                    log.exception('Reimaging error. Unlocking machines...')
+                    unlock_many(machines, user)
+                    continue
             return machines
         elif response.status_code == 503:
             log.error('Insufficient nodes available to lock %d %s nodes.',