Merge "Error when adding SR-IOV interfaces in SR-IOV context"
[yardstick.git] / yardstick / network_services / vnf_generic / vnf / tg_ixload.py
index 61c0454..02e7803 100644 (file)
@@ -22,10 +22,10 @@ import shutil
 from collections import OrderedDict
 from subprocess import call
 
-from yardstick.common.utils import makedirs
+from yardstick.common import utils
 from yardstick.network_services.vnf_generic.vnf.sample_vnf import SampleVNFTrafficGen
 from yardstick.network_services.vnf_generic.vnf.sample_vnf import ClientResourceHelper
-from yardstick.benchmark.scenarios.networking.vnf_generic import find_relative_file
+
 
 LOG = logging.getLogger(__name__)
 
@@ -91,11 +91,12 @@ class IxLoadResourceHelper(ClientResourceHelper):
                     self.result[key].append(value)
 
     def setup(self):
-        # TODO: fixupt scenario_helper to hanlde ixia
+        # NOTE: fixup scenario_helper to hanlde ixia
         self.resource_file_name = \
-            find_relative_file(self.scenario_helper.scenario_cfg['ixia_profile'],
-                               self.scenario_helper.scenario_cfg["task_path"])
-        makedirs(self.RESULTS_MOUNT)
+            utils.find_relative_file(
+                self.scenario_helper.scenario_cfg['ixia_profile'],
+                self.scenario_helper.scenario_cfg["task_path"])
+        utils.makedirs(self.RESULTS_MOUNT)
         cmd = MOUNT_CMD.format(self.vnfd_helper.mgmt_interface, self)
         LOG.debug(cmd)
 
@@ -103,7 +104,7 @@ class IxLoadResourceHelper(ClientResourceHelper):
             call(cmd, shell=True)
 
         shutil.rmtree(self.RESULTS_MOUNT, ignore_errors=True)
-        makedirs(self.RESULTS_MOUNT)
+        utils.makedirs(self.RESULTS_MOUNT)
         shutil.copy(self.resource_file_name, self.RESULTS_MOUNT)
 
     def make_aggregates(self):
@@ -113,7 +114,7 @@ class IxLoadResourceHelper(ClientResourceHelper):
     def collect_kpi(self):
         if self.data:
             self._result.update(self.data)
-        LOG.info("Collect {0} KPIs {1}".format(self.RESOURCE_WORD, self._result))
+        LOG.info("Collect %s KPIs %s", self.RESOURCE_WORD, self._result)
         return self._result
 
     def log(self):
@@ -170,9 +171,6 @@ class IxLoadTrafficGen(SampleVNFTrafficGen):
         self.resource_helper.log()
         self.resource_helper.data = self.resource_helper.make_aggregates()
 
-    def instantiate(self, scenario_cfg, context_cfg):
-        super(IxLoadTrafficGen, self).instantiate(scenario_cfg, context_cfg)
-
     def terminate(self):
         call(["pkill", "-9", "http_ixload.py"])
         super(IxLoadTrafficGen, self).terminate()