From 95f2491ed89ac99b0d8bd006b4a13cbeb1eb96ce Mon Sep 17 00:00:00 2001 From: "Michael S. Pedersen" Date: Tue, 3 Dec 2019 11:38:32 +0000 Subject: NFVBENCH-153 Add support for python3 JIRA: NFVBENCH-153 Done using 2to3-3.6 with additional changes to fix data parsing and testing (tox) Signed-off-by: Michael S. Pedersen Change-Id: I242902f800da543d780507828c9bd1fbf409da6d --- nfvbench/traffic_gen/dummy.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nfvbench/traffic_gen/dummy.py') 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 -- cgit 1.2.3-korg