Lines Matching refs:afe_host
257 def _create_host(hostname, afe, afe_host): argument
270 'afe_host': afe_host,
276 def _try_lock_host(afe_host): argument
288 afe_host.modify(locked=True,
296 def _try_unlock_host(afe_host): argument
308 afe_host.modify(locked=False, lock_reason='')
365 afe_host = afe.get_hosts(id=host_id)[0]
366 if afe_host.status in host_states.IDLE_STATES:
372 def _ensure_host_idle(afe, afe_host): argument
393 if afe_host.shard:
394 afe = frontend.AFE(server=afe_host.shard)
395 afe_host = afe.get_hosts(id=afe_host.id)[0]
396 if afe_host.status in host_states.IDLE_STATES:
398 afe.run('abort_special_tasks', host_id=afe_host.id, is_active=1)
399 return not retry.timeout(_wait_for_idle, (afe, afe_host.id),
425 afe_host = hostlist[0]
426 if not afe_host.locked:
427 if _try_lock_host(afe_host):
431 if not _ensure_host_idle(afe, afe_host):
432 if unlock_on_failure and not _try_unlock_host(afe_host):
441 afe_host = afe.create_host(hostname,
448 _ensure_label_in_afe(afe_host, 'board', arguments.board)
449 _ensure_label_in_afe(afe_host, 'model', arguments.model)
451 afe_host = afe.get_hosts([hostname])[0]
452 return afe_host, unlock_on_failure
455 def _ensure_label_in_afe(afe_host, label_name, label_value): argument
467 labels = labellib.LabelsMapping(afe_host.labels)
469 afe_host.add_labels(['%s:%s' % (label_name, label_value)])
477 afe_host.hostname))
558 afe_host, unlock_on_failure = _get_afe_host(afe, hostname, host_attrs,
562 host = _create_host(hostname, afe, afe_host)
575 afe_host.add_labels([platform])
576 version = [label for label in afe_host.labels
579 afe_host.remove_labels(version)
581 if unlock_on_failure and not _try_unlock_host(afe_host):
588 if not _try_unlock_host(afe_host):
728 afe_host = afe.get_hosts(hostname=host)
729 if afe_host:
730 servo_port = afe_host[0].attributes.get(servo_host.SERVO_PORT_ATTR)