commit | c6509e6c32d8791c68377bcf267d0a6db4282436 | [log] [tgz] |
---|---|---|
author | Dan Shi <dshi@chromium.org> | Mon Oct 20 11:19:51 2014 -0700 |
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | Tue Oct 21 05:03:43 2014 +0000 |
tree | 503c960cc45d8fb36db273b02a04db56f2666c17 | |
parent | 52ae3ad7250ff444ac6835c5e8572ce9884f97a8 [diff] [blame] |
[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