diff options
author | 2016-01-27 13:03:51 +0200 | |
---|---|---|
committer | 2016-01-27 13:03:51 +0200 | |
commit | c581c5bb6314b5f80d315c23354f8866ed2a71ff (patch) | |
tree | 8e1e4e041e027f3c14a542730ffd688882c69522 /scripts/automation/trex_control_plane/console/trex_console.py | |
parent | 52f599e870f0a3d98cebdf4d49607a6f50cf3380 (diff) | |
parent | 1e69b27f272fef2e3124693b865521a4927418f5 (diff) |
Merge to latest
Diffstat (limited to 'scripts/automation/trex_control_plane/console/trex_console.py')
-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__': |