From: Zack Cerza Date: Mon, 15 Sep 2025 17:25:39 +0000 (-0600) Subject: lock.ops.lock_many: Unlock on reimage failure X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9147723e95d89e71ae48959a50628feb035f80b8;p=teuthology.git lock.ops.lock_many: Unlock on reimage failure Signed-off-by: Zack Cerza --- diff --git a/teuthology/lock/ops.py b/teuthology/lock/ops.py index 968ab8641..f9662b44c 100644 --- a/teuthology/lock/ops.py +++ b/teuthology/lock/ops.py @@ -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.',