This will help prevent machines with cephtest dirs still present from
being used. It's easy to unlock machines - the targets yaml fragment
is output during a run.
default=False,
help='block until locking machines succeeds (use with --lock)',
)
- parser.add_argument(
- '--keep-locked-on-error',
- action='store_true',
- default=False,
- help='unlock machines only if the test succeeds (use with --lock)',
- )
args = parser.parse_args()
return args
if ctx.block:
assert ctx.lock, \
'the --block option is only supported with the --lock option'
- if ctx.keep_locked_on_error:
- assert ctx.lock, \
- 'the --keep_locked_on_error option is only supported with the --lock option'
from teuthology.misc import read_config
read_config(ctx)
try:
yield
finally:
- if not ctx.keep_locked_on_error or ctx.summary.get('success', False):
+ if ctx.summary.get('success', False):
log.info('Unlocking machines...')
for machine in ctx.config['targets'].iterkeys():
lock.unlock(ctx, machine, ctx.owner)