From 77ec431105aec379f3cb13df348f87b7e801fbc1 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Thu, 30 Jan 2014 00:10:12 -0800 Subject: [PATCH] internal.py: add global config key 'unlock_on_failure' When testing new tasks, it's a drag to have to keep manually unlocking the targets. Default behavior is to keep them locked for any failure; this allows overriding that choice for the case where the failure is in debugging the task, where the state of the targets isn't important. Signed-off-by: Dan Mick --- teuthology/task/internal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index a0e220d598..b916f11a95 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -132,7 +132,8 @@ def lock_machines(ctx, config): try: yield finally: - if ctx.summary.get('success', False): + if ctx.config.get('unlock_on_failure', False) or \ + ctx.summary.get('success', False): log.info('Unlocking machines...') for machine in ctx.config['targets'].iterkeys(): lock.unlock_one(ctx, machine, ctx.owner) -- 2.39.5