| from autotest_lib.client.common_lib import utils |
| from autotest_lib.frontend.shared import rest_client |
| from autotest_lib.server import frontend |
| |
| keyvals = utils.read_keyval(job.resultdir) |
| |
| planner_rpc = frontend.Planner() |
| afe_rest = rest_client.Resource.load( |
| 'http://%s/afe/server/resources' % keyvals['server']) |
| |
| |
| label = afe_rest.labels.get(name=keyvals['label_name']).members[0].get() |
| |
| for machine in machines: |
| hostname = hosts.create_host(machine).hostname |
| host = afe_rest.hosts.get(hostname=hostname).members[0] |
| label.hosts.post({'host': host}) |
| |
| planner_rpc.run('modify_plan', id=keyvals['plan_id'], initialized=True) |