summaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts/standalone/model.py
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-28 16:17:27 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-06-28 16:17:27 +0000
commiteb54a9e65e838e092e5acb5a8bd4119dd2e9f556 (patch)
tree41af1dad6cd4fe99638f29b92cb7cfbb70987fdb /yardstick/benchmark/contexts/standalone/model.py
parent931c7d87597fd61f9e300be2637a0bdd485001d9 (diff)
parent90919566f056e1881c7d35c45ef6dc9725dcf18e (diff)
Merge "Extended Context class with get_physical_nodes functionality" into stable/fraser
Diffstat (limited to 'yardstick/benchmark/contexts/standalone/model.py')
-rw-r--r--yardstick/benchmark/contexts/standalone/model.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/yardstick/benchmark/contexts/standalone/model.py b/yardstick/benchmark/contexts/standalone/model.py
index 5134217a9..e55523574 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.yaml_loader import yaml_load
+from yardstick.common.utils import read_yaml_file
from yardstick.network_services.utils import PciAddress
from yardstick.network_services.helpers.cpu import CpuSysCores
@@ -368,26 +368,18 @@ class StandaloneContextHelper(object):
return pf_vfs
- def read_config_file(self):
- """Read from config file"""
-
- with open(self.file_path) as stream:
- LOG.info("Parsing pod file: %s", self.file_path)
- cfg = yaml_load(stream)
- return cfg
-
def parse_pod_file(self, file_path, nfvi_role='Sriov'):
self.file_path = file_path
nodes = []
nfvi_host = []
try:
- cfg = self.read_config_file()
+ cfg = 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 = self.read_config_file()
+ cfg = 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])