Merge "Error when adding SR-IOV interfaces in SR-IOV context"
[yardstick.git] / yardstick / network_services / vnf_generic / vnf / tg_rfc2544_ixia.py
index a8b19cf..265d0b7 100644 (file)
@@ -19,11 +19,11 @@ import os
 import logging
 import sys
 
-from yardstick.common.utils import ErrorClass
+from yardstick.common import utils
+from yardstick import error
 from yardstick.network_services.vnf_generic.vnf.sample_vnf import SampleVNFTrafficGen
 from yardstick.network_services.vnf_generic.vnf.sample_vnf import ClientResourceHelper
 from yardstick.network_services.vnf_generic.vnf.sample_vnf import Rfc2544ResourceHelper
-from yardstick.benchmark.scenarios.networking.vnf_generic import find_relative_file
 
 LOG = logging.getLogger(__name__)
 
@@ -36,7 +36,7 @@ sys.path.append(IXNET_LIB)
 try:
     from IxNet import IxNextgen
 except ImportError:
-    IxNextgen = ErrorClass
+    IxNextgen = error.ErrorClass
 
 
 class IxiaRfc2544Helper(Rfc2544ResourceHelper):
@@ -122,8 +122,9 @@ class IxiaResourceHelper(ClientResourceHelper):
 
         # we don't know client_file_name until runtime as instantiate
         client_file_name = \
-            find_relative_file(self.scenario_helper.scenario_cfg['ixia_profile'],
-                               self.scenario_helper.scenario_cfg["task_path"])
+            utils.find_relative_file(
+                self.scenario_helper.scenario_cfg['ixia_profile'],
+                self.scenario_helper.scenario_cfg["task_path"])
         self.client.ix_load_config(client_file_name)
         time.sleep(WAIT_AFTER_CFG_LOAD)
 
@@ -149,7 +150,7 @@ class IxiaResourceHelper(ClientResourceHelper):
                 self.client.ix_stop_traffic()
                 samples = self.generate_samples(traffic_profile.ports)
                 self._queue.put(samples)
-                status, samples = traffic_profile.get_drop_percentage(self, samples, min_tol,
+                status, samples = traffic_profile.get_drop_percentage(samples, min_tol,
                                                                       max_tol, self.client, mac)
 
                 current = samples['CurrentDropPercentage']
@@ -174,7 +175,7 @@ class IxiaResourceHelper(ClientResourceHelper):
                     break
 
             self.client.ix_stop_traffic()
-        except Exception:
+        except Exception:  # pylint: disable=broad-except
             LOG.exception("Run Traffic terminated")
 
         self._terminated.value = 1
@@ -201,9 +202,6 @@ class IxiaTrafficGen(SampleVNFTrafficGen):
     def _check_status(self):
         pass
 
-    def scale(self, flavor=""):
-        pass
-
     def terminate(self):
         self.resource_helper.stop_collect()
         super(IxiaTrafficGen, self).terminate()