summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-12-12 17:38:43 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-12-19 11:23:48 +0200
commitcc4bd93b660505a7c9d8e370a1220377907fa6d2 (patch)
treeb0296f645a76f50d3ca0a957a70f54a7b3afc23b /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
parentac3784a3bad416d45b93cb17be551726e08c545d (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_client.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
index 964acce7..2aa0450d 100755
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
@@ -15,6 +15,7 @@ from .utils import parsing_opts, text_tables, common
from .utils.common import *
from .utils.text_opts import *
from functools import wraps
+from texttable import ansi_len
from collections import namedtuple
from yaml import YAMLError
@@ -2025,7 +2026,6 @@ class STLClient(object):
@__api_check(True)
def get_xstats(self, port_id):
- print(port_id)
"""
Get extended stats of port: all the counters as dict.
@@ -3407,9 +3407,8 @@ class STLClient(object):
self.add_streams(profile.get_streams(), ports = port)
except STLError as e:
- error = 'Unknown error.'
- for line in e.brief().split('\n'):
- if line:
+ for line in e.brief().splitlines():
+ if ansi_len(line.strip()):
error = line
msg = format_text("\nError loading profile '{0}'".format(opts.file[0]), 'bold')
self.logger.log(msg + '\n')