diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-05-11 19:41:26 +0800 |
---|---|---|
committer | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-05-15 13:51:24 +0800 |
commit | 0af297e4e9622cb6d040e9e30daffe1d43970aaa (patch) | |
tree | d43c7d8e48d2987d5a57ed21497fba437f78653e | |
parent | 8522b38a1b06bfe3c334c4d70d365058b7bf03ca (diff) |
Get rid of `changed=false` flag in test result
Change-Id: I74c9634b708dbad82e6e4b0a04b44e16ff01ffdd
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
-rw-r--r-- | qtip/ansible_library/plugins/action/calculate.py | 7 | ||||
-rw-r--r-- | resources/ansible_roles/qtip/tasks/calculate.yml | 11 |
2 files changed, 11 insertions, 7 deletions
diff --git a/qtip/ansible_library/plugins/action/calculate.py b/qtip/ansible_library/plugins/action/calculate.py index ee3b8e3a..8d5fa1f7 100644 --- a/qtip/ansible_library/plugins/action/calculate.py +++ b/qtip/ansible_library/plugins/action/calculate.py @@ -10,6 +10,7 @@ ############################################################################## import humanfriendly +import json import numbers from numpy import mean import yaml @@ -37,7 +38,11 @@ class ActionModule(ActionBase): with open(self._task.args.get('spec')) as stream: spec = yaml.safe_load(stream) - metrics = self._task.args.get('metrics') + metrics_files = self._task.args.get('metrics') + metrics = {} + for metric, filename in metrics_files.items(): + with open(filename) as f: + metrics[metric] = json.load(f) dest = self._task.args.get('dest') return calc_qpi(spec, metrics, dest=dest) diff --git a/resources/ansible_roles/qtip/tasks/calculate.yml b/resources/ansible_roles/qtip/tasks/calculate.yml index e4107e4d..62779c73 100644 --- a/resources/ansible_roles/qtip/tasks/calculate.yml +++ b/resources/ansible_roles/qtip/tasks/calculate.yml @@ -12,12 +12,11 @@ - name: calculate compute score calculate: metrics: - ssl_rsa: "{{ ssl_rsa_metrics }}" - ssl_aes: "{{ ssl_aes_metrics }}" - dpi_throughput: "{{ dpi_metrics }}" - intmem: "{{ intmem_metrics }}" - floatmem: "{{ floatmem_metrics }}" + ssl_rsa: "{{ qtip_results }}/ssl/rsa-metrics.json" + ssl_aes: "{{ qtip_results }}/ssl/aes-metrics.json" + dpi_throughput: "{{ qtip_results }}/dpi/metrics.json" + intmem: "{{ qtip_results }}/memory/integer-metrics.json" + floatmem: "{{ qtip_results }}/memory/float-metrics.json" spec: "{{ qtip_resources }}/QPI/compute.yaml" dest: "{{ qtip_results }}/compute.json" - register: qpi_result delegate_to: localhost |