diff options
Diffstat (limited to 'scripts/automation/trex_control_plane/console')
-rwxr-xr-x | scripts/automation/trex_control_plane/console/trex_console.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/automation/trex_control_plane/console/trex_console.py b/scripts/automation/trex_control_plane/console/trex_console.py index 88ff45dc..1defc6b2 100755 --- a/scripts/automation/trex_control_plane/console/trex_console.py +++ b/scripts/automation/trex_control_plane/console/trex_console.py @@ -29,14 +29,14 @@ import sys import tty, termios import trex_root_path from common.trex_streams import * -from client.trex_stateless_client import STLClient, LoggerApi, STLError +from client.trex_stateless_client import STLClient, LoggerApi from common.text_opts import * from client_utils.general_utils import user_input, get_current_user from client_utils import parsing_opts import trex_tui +from common.trex_stl_exceptions import * from functools import wraps - __version__ = "1.1" # console custom logger @@ -56,7 +56,7 @@ class ConsoleLogger(LoggerApi): # override this for the prompt fix def async_log (self, msg, level = LoggerApi.VERBOSE_REGULAR, newline = True): self.log(msg, level, newline) - if self.prompt_redraw: + if ( (self.level >= LoggerApi.VERBOSE_REGULAR) and self.prompt_redraw ): self.prompt_redraw() self.flush() @@ -717,13 +717,14 @@ def main(): # TUI or no acquire will give us READ ONLY mode try: - stateless_client.connect("RO") + stateless_client.connect() except STLError as e: logger.log("Log:\n" + format_text(e.brief() + "\n", 'bold')) return if not options.tui and options.acquire: try: + # acquire all ports stateless_client.acquire() except STLError as e: logger.log("Log:\n" + format_text(e.brief() + "\n", 'bold')) @@ -751,7 +752,8 @@ def main(): print "\n\n*** Caught Ctrl + C... Exiting...\n\n" finally: - stateless_client.teardown(stop_traffic = False) + with stateless_client.logger.supress(): + stateless_client.disconnect(stop_traffic = False) if __name__ == '__main__': |