diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2017-03-05 10:21:44 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2017-03-05 10:21:44 +0200 |
commit | 7c67ba7242ce919a64551ebb61c7f68f5a97cbd2 (patch) | |
tree | b2643b6ce25be30f6efb3ecfb743b050cc7f0df6 | |
parent | 140dbd05cde4f67ad86a849b9882436e36114da2 (diff) |
STL console: sort streams in numerical order
https://trex-tgn.cisco.com/youtrack/issue/trex-366
Change-Id: I8691a20c14fb55a66145c64ee1a1a3971e140a76
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py | 7 |
1 files changed, 4 insertions, 3 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 6565f83a..9a2cfc07 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 @@ -1013,8 +1013,9 @@ class Port(object): if sync: self.sync_streams() - data = {} - for id, obj in self.streams.items(): + data = OrderedDict() + for id in sorted(map(int, self.streams.keys())): + obj = self.streams[str(id)] # lazy build scapy repr. if not 'pkt_type' in obj: @@ -1028,7 +1029,7 @@ class Port(object): ('next_stream', obj['next_id'] if not '-1' else 'None') ]) - return {"streams" : OrderedDict(sorted(data.items())) } + return {"streams" : data} ######## attributes are a complex type (dict) that might be manipulated through the async thread ############# |