aboutsummaryrefslogtreecommitdiffstats
path: root/qtip/loader/qpi.py
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-08-17 02:35:04 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-17 02:35:04 +0000
commitef578e8259d2d43c497cbc6e4d0d15a2afb2f076 (patch)
tree5a3156408cd027aeb51b30ecef501dca7c89b2dd /qtip/loader/qpi.py
parentfa7d89ee68d4b345530c6bc036d80ebbc0a1fc04 (diff)
parent86b0ef02f5c0ec0ec80ffb0f507ecf7e573611c6 (diff)
Merge "Migrate contents from benchmarks to resources"
Diffstat (limited to 'qtip/loader/qpi.py')
-rw-r--r--qtip/loader/qpi.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/qtip/loader/qpi.py b/qtip/loader/qpi.py
index 2a85766e..48f52e84 100644
--- a/qtip/loader/qpi.py
+++ b/qtip/loader/qpi.py
@@ -9,6 +9,7 @@
from yaml_file import YamlFileLoader
+from qtip.base.constant import FormulaName
from qtip.base.constant import SpecProp
from qtip.util.formula import Formula
@@ -31,5 +32,5 @@ class QPISpec(YamlFileLoader):
class Section(object):
def __init__(self, content, paths=None):
self.name = content[SpecProp.NAME]
- self.weight = content[SpecProp.WEIGHT]
- self.formula = Formula(content[SpecProp.FORMULA])
+ self.weight = content.get(SpecProp.WEIGHT, None)
+ self.formula = Formula(content.get(SpecProp.FORMULA, FormulaName.ARITHMETIC_MEAN))