From 2bcbca455b063e3ef6f90e85a1fac4994a0e6a51 Mon Sep 17 00:00:00 2001 From: imarom Date: Wed, 23 Mar 2016 11:55:07 +0200 Subject: python 3 - regression --- .../trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/automation/trex_control_plane') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py index eed20485..4f8ce3e6 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py @@ -534,15 +534,17 @@ class STLStream(object): else: new_data = ''.join([chr(c) if chr(c) in good_printable else r'\x{0:02x}'.format(c) for c in data]) - payload_start = packet_command.find("Raw(load='") + payload_start = packet_command.find("Raw(load=") if payload_start != -1: packet_command = packet_command[:payload_start-1] layers = packet_command.split('/') + if payload: if len(new_data) and new_data == new_data[0] * len(new_data): layers.append("Raw(load='%s' * %s)" % (new_data[0], len(new_data))) else: layers.append("Raw(load='%s')" % new_data) + packet_code = 'packet = (' + (' / \n ').join(layers) + ')' vm_list = [] for inst in self.fields['vm']['instructions']: -- cgit 1.2.3-korg