summaryrefslogtreecommitdiffstats
path: root/qtip
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-12 17:08:23 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-16 11:23:38 +0000
commit6d6259490b9c0897ba493070516600fcff94b312 (patch)
tree9d8c0928d224a362faea53d7fce2dd2c4b11c03c /qtip
parent550a975949328619139631e363c3bc1b48411402 (diff)
Load benchmark specification from external file
Change-Id: If72f1d98b90f9666c17aa28b3b88f32178ee4166 Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'qtip')
-rw-r--r--qtip/ansible_library/plugins/action/calculate.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/qtip/ansible_library/plugins/action/calculate.py b/qtip/ansible_library/plugins/action/calculate.py
index f88729b7..ac7f10f2 100644
--- a/qtip/ansible_library/plugins/action/calculate.py
+++ b/qtip/ansible_library/plugins/action/calculate.py
@@ -10,6 +10,7 @@
##############################################################################
from numpy import mean
+import yaml
from ansible.plugins.action import ActionBase
from ansible.utils.display import Display
@@ -28,7 +29,9 @@ class ActionModule(ActionBase):
if result.get('skipped', False):
return result
- spec = self._task.args.get('spec')
+ with open(self._task.args.get('spec')) as stream:
+ spec = yaml.safe_load(stream)
+
metrics = self._task.args.get('metrics')
return calc_qpi(spec, metrics)