[autotest] add script for adding newly detected supported labels to host

This commit creates a new script, suitable for running in a cron job,
that iterates through all of an autotest server's hosts, queries them
for supported labels, and adds these labels to their host entries.

BUG=chromium-os:37187
TEST=Ran ./add_detected_host_labels.py on local machine with autotest
instance, with two DUT hosts and one invalid host entry. The two
DUTs had their labels duly updated, and the invalid host failed to
update but did not crash the script.
Ran ./add_detected_host_labels.py with no labels known to the autotest
server. Script correctly skipped adding of unknown labels.

Change-Id: I9b117d40571731d90e4574811f876ca6b174d468
Reviewed-on: https://gerrit.chromium.org/gerrit/42466
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
1 file changed