summaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen/xena/xena.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2018-04-03 07:17:42 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-04-03 07:17:42 +0000
commit2814e71322f7da9dd6ad9988b2648316cc7bd034 (patch)
tree1d97a543a7d8c3dadadeb9842c12fff99159bdef /tools/pkt_gen/xena/xena.py
parente1c33f5984089d32ff6615df5c993187d6c132e2 (diff)
parent391ed4e6a11e108ac7ea88fd649e362931aff4c5 (diff)
Merge "scapy: Fix conflict of scapy libraries"
Diffstat (limited to 'tools/pkt_gen/xena/xena.py')
-rwxr-xr-xtools/pkt_gen/xena/xena.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py
index 19b44f0b..b465b2db 100755
--- a/tools/pkt_gen/xena/xena.py
+++ b/tools/pkt_gen/xena/xena.py
@@ -32,8 +32,6 @@ import xml.etree.ElementTree as ET
from collections import OrderedDict
from time import sleep
-import scapy.layers.inet as inet
-
from conf import merge_spec
from conf import settings
from core.results.results_constants import ResultsConstants
@@ -149,6 +147,10 @@ class Xena(ITrafficGenerator):
:param reverse: Swap source and destination info when building header
:return: packet header in hex
"""
+ # import can't be performed at module level, because it conflicts with import
+ # of customized scapy version by T-Rex
+ import scapy.layers.inet as inet
+
srcmac = self._params['traffic']['l2'][
'srcmac'] if not reverse else self._params['traffic']['l2'][
'dstmac']