summaryrefslogtreecommitdiffstats
path: root/nfvbench/traffic_gen/dummy.py
diff options
context:
space:
mode:
authorMichael S. Pedersen <michael.soelvkaer@gmail.com>2019-12-03 11:38:32 +0000
committerMichael S. Pedersen <michael.soelvkaer@gmail.com>2019-12-09 22:07:08 +0000
commit95f2491ed89ac99b0d8bd006b4a13cbeb1eb96ce (patch)
tree8d2d8cd00f3284036e9bf78d9ec9bfdb3e95c80b /nfvbench/traffic_gen/dummy.py
parent24314713446b6411cedce4329ab5ebfd6da678a2 (diff)
NFVBENCH-153 Add support for python34.0.0
JIRA: NFVBENCH-153 Done using 2to3-3.6 with additional changes to fix data parsing and testing (tox) Signed-off-by: Michael S. Pedersen <michael.soelvkaer@gmail.com> Change-Id: I242902f800da543d780507828c9bd1fbf409da6d
Diffstat (limited to 'nfvbench/traffic_gen/dummy.py')
-rw-r--r--nfvbench/traffic_gen/dummy.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nfvbench/traffic_gen/dummy.py b/nfvbench/traffic_gen/dummy.py
index ef7f272..7fd3fdb 100644
--- a/nfvbench/traffic_gen/dummy.py
+++ b/nfvbench/traffic_gen/dummy.py
@@ -13,8 +13,8 @@
# under the License.
from nfvbench.log import LOG
-from traffic_base import AbstractTrafficGenerator
-import traffic_utils as utils
+from .traffic_base import AbstractTrafficGenerator
+from . import traffic_utils as utils
class DummyTG(AbstractTrafficGenerator):
@@ -176,8 +176,8 @@ class DummyTG(AbstractTrafficGenerator):
def fetch_capture_packets(self):
def _get_packet_capture(mac):
# convert text to binary
- src_mac = mac.replace(':', '').decode('hex')
- return {'binary': 'SSSSSS' + src_mac}
+ src_mac = bytearray.fromhex(mac.replace(':', '')).decode()
+ return {'binary': bytes('SSSSSS' + src_mac, 'ascii')}
# for packet capture, generate 2*scc random packets
# normally we should generate packets coming from the right dest macs