summaryrefslogtreecommitdiffstats
path: root/scripts/automation
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-02-18 09:49:26 -0500
committerimarom <imarom@cisco.com>2016-02-23 03:07:59 -0500
commita88db6885843221757f3cfb4bb3b2e74f57395bb (patch)
tree72b2377bc663c25c22eef0b930b42a07e0453914 /scripts/automation
parent9264010486847b599cc31ef56f146a4d73737135 (diff)
deepcopy for stream per port history
Diffstat (limited to 'scripts/automation')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py16
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()