diff options
Diffstat (limited to 'scripts/automation/trex_control_plane/stl')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py index 838a49ed..29bad041 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py @@ -4,6 +4,7 @@ from collections import namedtuple, OrderedDict import trex_stl_stats from trex_stl_types import * import time +import copy StreamOnPort = namedtuple('StreamOnPort', ['compiled_stream', 'metadata']) @@ -160,8 +161,8 @@ class Port(object): return self.err("Please stop port before attempting to add streams") # listify - streams_list = streams_list if isinstance(streams_list, list) else [streams_list] - + streams_list = copy.deepcopy(streams_list if isinstance(streams_list, list) else [streams_list]) + lookup = {} # allocate IDs @@ -171,10 +172,12 @@ class Port(object): lookup[stream.get_name()] = stream.get_id() - # resolve names + batch = [] + + for stream in streams_list: - next_id = -1 + next_id = -1 next = stream.get_next() if next: if not next in lookup: @@ -183,10 +186,7 @@ class Port(object): stream.set_next_id(next_id) - - - batch = [] - for stream in streams_list: + stream_json = stream.to_json() stream_json['next_stream_id'] = stream.get_next_id() |