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-09-28 14:22:31 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-09-28 14:22:31 +0300
commiteef160385f07aa94e1dfc67b481a659465410d61 (patch)
tree94f8619e23f86551cbf9fec9d944f0437478f47c /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
parent457c257e0089253c3c5a540047ff53e5af1cc8ff (diff)
trex-console: add print of Python error in case of error loading profile in TUI
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.py10
1 files changed, 7 insertions, 3 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 3fe31d4d..b5ae0f94 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
@@ -2867,10 +2867,14 @@ class STLClient(object):
self.add_streams(profile.get_streams(), ports = port)
except STLError as e:
- msg = format_text("\nError while loading profile '{0}'\n".format(opts.file[0]), 'bold')
- self.logger.log(msg)
+ error = 'Unknown error.'
+ for line in e.brief().split('\n'):
+ if line:
+ error = line
+ msg = format_text("\nError loading profile '{0}'".format(opts.file[0]), 'bold')
+ self.logger.log(msg + '\n')
self.logger.log(e.brief() + "\n")
- return RC_ERR(msg)
+ return RC_ERR("%s: %s" % (msg, error))
if opts.dry: