Merge "Resolve NameError in test_utils.py"
[yardstick.git] / yardstick / benchmark / contexts / standalone / model.py
index 4d43f26..764cde3 100644 (file)
@@ -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
 
@@ -45,7 +45,7 @@ VM_TEMPLATE = """
   <vcpu cpuset='{cpuset}'>{vcpu}</vcpu>
  {cputune}
   <os>
-    <type arch="x86_64" machine="pc-i440fx-utopic">hvm</type>
+    <type arch="x86_64" machine="pc-i440fx-xenial">hvm</type>
     <boot dev="hd" />
   </os>
   <features>
@@ -394,26 +394,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])