Lines Matching refs:afe_host
184 def _create_host(hostname, afe, afe_host): argument
197 'afe_host': afe_host,
204 def _try_lock_host(afe_host): argument
216 afe_host.modify(locked=True,
225 def _try_unlock_host(afe_host): argument
237 afe_host.modify(locked=False, lock_reason='')
297 afe_host = afe.get_hosts(id=host_id)[0]
298 if afe_host.status in host_states.IDLE_STATES:
305 def _ensure_host_idle(afe, afe_host): argument
326 if afe_host.shard:
327 afe = frontend.AFE(server=afe_host.shard)
328 afe_host = afe.get_hosts(id=afe_host.id)[0]
329 if afe_host.status in host_states.IDLE_STATES:
331 afe.run('abort_special_tasks', host_id=afe_host.id, is_active=1)
332 return not retry.timeout(_wait_for_idle, (afe, afe_host.id),
359 afe_host = hostlist[0]
360 if not afe_host.locked:
361 if _try_lock_host(afe_host):
365 if not _ensure_host_idle(afe, afe_host):
366 if unlock_on_failure and not _try_unlock_host(afe_host):
375 afe_host = afe.create_host(hostname,
384 _ensure_label_in_afe(afe_host, 'board', arguments.board)
385 _ensure_label_in_afe(afe_host, 'model', arguments.model)
387 afe_host = afe.get_hosts([hostname])[0]
388 return afe_host, unlock_on_failure
392 def _ensure_label_in_afe(afe_host, label_name, label_value): argument
404 labels = labellib.LabelsMapping(afe_host.labels)
406 afe_host.add_labels(['%s:%s' % (label_name, label_value)])
414 afe_host.hostname))
513 afe_host, unlock_on_failure = _get_afe_host(afe, hostname, host_attrs,
517 host = _create_host(hostname, afe, afe_host)
535 afe_host.add_labels([platform])
536 version = [label for label in afe_host.labels
539 afe_host.remove_labels(version)
541 if unlock_on_failure and not _try_unlock_host(afe_host):
548 if not _try_unlock_host(afe_host):
699 afe_host = afe.get_hosts(hostname=host)
700 if afe_host:
701 servo_port = afe_host[0].attributes.get(servo_constants.SERVO_PORT_ATTR)