diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index 4c8341f9a79..fd90f7b665e 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -70,7 +70,7 @@ def lock_machines(ctx, config): try: yield finally: - if ctx.summary['success'] or not ctx.keep_locked_on_error: + if not ctx.keep_locked_on_error or ctx.summary.get('success', False): log.info('Unlocking machines...') for machine in ctx.config['targets']: lock.unlock(ctx, machine, ctx.owner)