Add intermediate variables for attacker,monitor,result_checker
[yardstick.git] / yardstick / benchmark / scenarios / availability / result_checker / baseresultchecker.py
index a24f26e..d1750ab 100644 (file)
@@ -6,12 +6,13 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
+from __future__ import absolute_import
 import pkg_resources
-import yaml
 import logging
 import os
 
 import yardstick.common.utils as utils
+from yardstick.common.yaml_loader import yaml_load
 
 LOG = logging.getLogger(__name__)
 
@@ -46,7 +47,7 @@ class ResultCheckerMgr(object):
     def verify(self):
         result = True
         for obj in self._result_checker_list:
-                result &= obj.success
+            result &= obj.success
         return result
 
 
@@ -57,7 +58,7 @@ class BaseResultChecker(object):
     def __init__(self, config, context):
         if not BaseResultChecker.resultchecker_cfgs:
             with open(resultchecker_conf_path) as stream:
-                BaseResultChecker.resultchecker_cfgs = yaml.load(stream)
+                BaseResultChecker.resultchecker_cfgs = yaml_load(stream)
         self.actualResult = object()
         self.expectedResult = object()
         self.success = False
@@ -65,10 +66,11 @@ class BaseResultChecker(object):
         self._config = config
         self._context = context
         self.setup_done = False
+        self.intermediate_variables = {}
 
     @staticmethod
     def get_resultchecker_cls(type):
-        '''return resultchecker instance of specified type'''
+        """return resultchecker instance of specified type"""
         resultchecker_type = type
         for checker_cls in utils.itersubclasses(BaseResultChecker):
             if resultchecker_type == checker_cls.__result_checker__type__: