diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-12-12 17:38:43 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-12-19 11:23:48 +0200 |
commit | cc4bd93b660505a7c9d8e370a1220377907fa6d2 (patch) | |
tree | b0296f645a76f50d3ca0a957a70f54a7b3afc23b /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py | |
parent | ac3784a3bad416d45b93cb17be551726e08c545d (diff) |
1) limit number of streams per port to 20k
2) fix showing error in TUI
3) represensation of STLError: show only errors if error, limit by 10 entries
Change-Id: Ib8de9222e7fc09dd67275283857d0d7e9cb5988c
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py index 81015ddc..5ae3cb27 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py @@ -50,11 +50,26 @@ class RC(): return (e if len(e) != 1 else e[0]) def __str__ (self): - s = "" - for x in self.rc_list: - if x.data: - s += format_text("\n{0}".format(x.data), 'bold') - return s + if self.good(): + s = "" + for x in self.rc_list: + if x.data: + s += format_text("\n{0}".format(x.data), 'bold') + return s + else: + show_count = 10 + err_list = [] + err_count = 0 + for x in self.rc_list: + if x.data and not x.rc: + err_count += 1 + if len(err_list) < show_count: + err_list.append(format_text(x.data, 'bold')) + s = '\n' if len(err_list) > 1 else '' + if err_count > show_count: + s += format_text('Occurred %s errors, showing first %s:\n' % (err_count, show_count), 'bold') + s += '\n'.join(err_list) + return s def __iter__(self): return self.rc_list.__iter__() |