[autotest] Skip hosts with no label assigned.

BUG=None
TEST=local run collect_host_stats.py

Change-Id: I6e67505451c35db4c05c127c879812930d2a1641
Reviewed-on: https://chromium-review.googlesource.com/224430
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
diff --git a/site_utils/host_label_utils.py b/site_utils/host_label_utils.py
index d283ecf..ff59d2c 100755
--- a/site_utils/host_label_utils.py
+++ b/site_utils/host_label_utils.py
@@ -94,7 +94,8 @@
     host_labels = {}
     for hit in results['hits']['hits']:
         hit = es_utils.convert_hit(hit['fields'])
-        host_labels[hit['hostname']] = hit['labels']
+        if 'labels' in hit:
+            host_labels[hit['hostname']] = hit['labels']
 
     return host_labels