from teuthology.config import config as teuth_config
from teuthology.parallel import parallel
from ..orchestra import cluster, remote, run
+from .. import report
log = logging.getLogger(__name__)
# We want to make sure there are always this many machines available
to_reserve = 5
+ # change the status during the locking process
+ report.try_push_job_info(config, dict(status='waiting'))
+
while True:
# get a candidate list of machines
machines = lock.list_locks(machine_type=machine_type, up=True,
ctx.config['targets'] = newscandict
else:
ctx.config['targets'] = newly_locked
- # FIXME: Ugh.
- log.info('\n '.join(['Locked targets:', ] + yaml.safe_dump(ctx.config['targets'], default_flow_style=False).splitlines()))
+ locked_targets = yaml.safe_dump(
+ ctx.config['targets'],
+ default_flow_style=False
+ ).splitlines()
+ log.info('\n '.join(['Locked targets:', ] + locked_targets))
+ # successfully locked machines, change status back to running
+ report.try_push_job_info(config, dict(status='running'))
break
elif not ctx.block:
assert 0, 'not enough machines are available'