]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
internal.py: add global config key 'unlock_on_failure'
authorDan Mick <dan.mick@inktank.com>
Thu, 30 Jan 2014 08:10:12 +0000 (00:10 -0800)
committerDan Mick <dan.mick@inktank.com>
Fri, 31 Jan 2014 21:07:45 +0000 (13:07 -0800)
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 <dan.mick@inktank.com>
teuthology/task/internal.py

index a0e220d59884a16b43e1862ae593544f9e37375d..b916f11a95ba3526d28de90bcf1fef6e8b00340a 100644 (file)
@@ -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)