diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-07-05 08:00:09 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-07-05 08:00:09 +0000 |
commit | 43eb5e0b4a03278b12c002ff5a5d1c6f58da35d6 (patch) | |
tree | 0a86f413b1b679076323350512ad0bcc138a0245 /yardstick/benchmark/contexts | |
parent | a7c1d2a9ea76951dbf9ec5e14fa9413156232f4a (diff) | |
parent | 4bf3b18f921b7bc7ecf3d34cb74fd80176cae8d5 (diff) |
Merge "Move "read_yaml_file" to common.yaml_loader"
Diffstat (limited to 'yardstick/benchmark/contexts')
-rw-r--r-- | yardstick/benchmark/contexts/base.py | 5 | ||||
-rw-r--r-- | yardstick/benchmark/contexts/standalone/model.py | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/yardstick/benchmark/contexts/base.py b/yardstick/benchmark/contexts/base.py index 1c798fbb3..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,13 @@ 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__ diff --git a/yardstick/benchmark/contexts/standalone/model.py b/yardstick/benchmark/contexts/standalone/model.py index 764cde3f7..ecddcbbe0 100644 --- a/yardstick/benchmark/contexts/standalone/model.py +++ b/yardstick/benchmark/contexts/standalone/model.py @@ -26,7 +26,7 @@ import xml.etree.ElementTree as ET from yardstick import ssh from yardstick.common import constants from yardstick.common import exceptions -from yardstick.common.utils import read_yaml_file +from yardstick.common import yaml_loader from yardstick.network_services.utils import PciAddress from yardstick.network_services.helpers.cpu import CpuSysCores @@ -399,13 +399,13 @@ class StandaloneContextHelper(object): nodes = [] nfvi_host = [] try: - cfg = 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(constants.YARDSTICK_ROOT_PATH, file_path) - cfg = read_yaml_file(self.file_path) + cfg = yaml_loader.read_yaml_file(self.file_path) nodes.extend([node for node in cfg["nodes"] if str(node["role"]) != nfvi_role]) nfvi_host.extend([node for node in cfg["nodes"] if str(node["role"]) == nfvi_role]) |