From ab72f9c49cabd945d35c946dce4158ea8e228e2a Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Sat, 13 May 2017 21:52:37 +0800 Subject: Implement sunburst badge for QPI Change-Id: Iccdec7b0ac223a38c846f73adc6bd0e53db3723b Signed-off-by: Yujun Zhang --- qtip/ansible_library/plugins/action/aggregate.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'qtip/ansible_library/plugins/action/aggregate.py') diff --git a/qtip/ansible_library/plugins/action/aggregate.py b/qtip/ansible_library/plugins/action/aggregate.py index f1451e06..36ea0ef1 100644 --- a/qtip/ansible_library/plugins/action/aggregate.py +++ b/qtip/ansible_library/plugins/action/aggregate.py @@ -42,9 +42,15 @@ class ActionModule(ActionBase): # aggregate QPI results @export_to_file def aggregate(hosts, basepath, src): - host_results = [{'host': host, 'result': json.load(open(os.path.join(basepath, host, src)))} for host in hosts] - score = int(mean([r['result']['score'] for r in host_results])) + host_results = [] + for host in hosts: + host_result = json.load(open(os.path.join(basepath, host, src))) + host_result['name'] = host + host_results.append(host_result) + score = int(mean([r['score'] for r in host_results])) return { 'score': score, - 'host_results': host_results + 'name': 'compute', + 'description': 'POD Compute QPI', + 'children': host_results } -- cgit 1.2.3-korg