summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/console
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-01-04 17:38:21 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-01-04 17:38:21 +0200
commitf11d01a06951ae9e55f16f1982b08f4552408014 (patch)
tree3b65fc33db0f0e6da092d214b87cae60cdd50eef /scripts/automation/trex_control_plane/stl/console
parentb91f77ffa89dc1f024e62c1ad475ac9208fb09a8 (diff)
console: move show_intro into try-finally to ensure release of ports
Change-Id: Icfe30379a24560cf0807edd239d3eb07d81a492f Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/console')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/console/trex_console.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/automation/trex_control_plane/stl/console/trex_console.py b/scripts/automation/trex_control_plane/stl/console/trex_console.py
index cecdd72e..c9956472 100755
--- a/scripts/automation/trex_control_plane/stl/console/trex_console.py
+++ b/scripts/automation/trex_control_plane/stl/console/trex_console.py
@@ -906,17 +906,16 @@ def main():
if options.readonly:
logger.log(format_text("\nRead only mode - only few commands will be available", 'bold'))
- show_intro(logger, stateless_client)
-
-
- # a script mode
- if options.batch:
- cont = run_script_file(options.batch[0], stateless_client)
- if not cont:
- return
-
# console
try:
+ show_intro(logger, stateless_client)
+
+ # a script mode
+ if options.batch:
+ cont = run_script_file(options.batch[0], stateless_client)
+ if not cont:
+ return
+
console = TRexConsole(stateless_client, options.verbose)
logger.prompt_redraw = console.prompt_redraw