Success of test may not have been set yet.

This commit is contained in:
Josh Durgin 2011-07-11 17:34:36 -07:00
parent f92b3a1cca
commit e69cf0b1b7

View File

@ -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)