summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/console/trex_console.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-01-25 10:04:26 -0500
committerimarom <imarom@cisco.com>2016-01-26 08:58:49 -0500
commit4c6450049d82fb9f98dbafe98d3ea1e229bf2a6d (patch)
tree5470af30949ba271129f723c0b0ff3e54f1deae5 /scripts/automation/trex_control_plane/console/trex_console.py
parentb6f06a038122d98c756c265916e6e9c4059d4e9d (diff)
API cleaning up
Diffstat (limited to 'scripts/automation/trex_control_plane/console/trex_console.py')
-rwxr-xr-xscripts/automation/trex_control_plane/console/trex_console.py9
1 files changed, 5 insertions, 4 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..62b68861 100755
--- a/scripts/automation/trex_control_plane/console/trex_console.py
+++ b/scripts/automation/trex_control_plane/console/trex_console.py
@@ -36,7 +36,6 @@ from client_utils import parsing_opts
import trex_tui
from functools import wraps
-
__version__ = "1.1"
# console custom logger
@@ -56,7 +55,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 +716,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 +751,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()
if __name__ == '__main__':