X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fcontexts%2Fbase.py;h=f3f5879ebac34555052b16cda764749cee7e4cc5;hb=d8cfab0d902b2d3d1a4234551807df68ac0b6b66;hp=022e365e4b136cf1b6f4bb3f421714197c4c84c4;hpb=ae2fdf6e81192a2a70beebf7c1c1247063e1e4ea;p=yardstick.git diff --git a/yardstick/benchmark/contexts/base.py b/yardstick/benchmark/contexts/base.py index 022e365e4..f3f5879eb 100644 --- a/yardstick/benchmark/contexts/base.py +++ b/yardstick/benchmark/contexts/base.py @@ -14,6 +14,7 @@ import os from yardstick.common import constants from yardstick.common import utils +from yardstick.common import yaml_loader from yardstick.common.constants import YARDSTICK_ROOT_PATH @@ -73,13 +74,16 @@ class Context(object): def read_pod_file(self, attrs): self.file_path = file_path = attrs.get("file", "pod.yaml") try: - cfg = utils.read_yaml_file(self.file_path) + cfg = yaml_loader.read_yaml_file(self.file_path) except IOError as io_error: if io_error.errno != errno.ENOENT: raise self.file_path = os.path.join(YARDSTICK_ROOT_PATH, file_path) - cfg = utils.read_yaml_file(self.file_path) + cfg = yaml_loader.read_yaml_file(self.file_path) + + for node in cfg["nodes"]: + node["ctx_type"] = self.__context_type__ self.nodes.extend(cfg["nodes"]) self.controllers.extend([node for node in cfg["nodes"]