From ae142588405743298d322310434ba28b9b8b8f74 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Mon, 30 Jan 2017 11:15:56 +0200 Subject: console scan6: ipv6 column width adaptive to length of addresses Change-Id: I08c7dd08487102bb09b337c20101a62469a38e7d Signed-off-by: Yaroslav Brustinov --- .../trex_control_plane/stl/trex_stl_lib/trex_stl_client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/automation/trex_control_plane/stl') 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 a6aa47aa..46ab668e 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 @@ -3080,10 +3080,13 @@ class STLClient(object): if not rc: self.logger.log(format_text(rc, 'bold')) elif rc.data(): + max_ip_len = 0 + for resp in rc.data(): + max_ip_len = max(max_ip_len, len(resp['ipv6'])) scan_table = TRexTextTable() scan_table.set_cols_align(['c', 'c', 'l']) scan_table.header(['Device', 'MAC', 'IPv6 address']) - scan_table.set_cols_width([9, 19, 42]) + scan_table.set_cols_width([9, 19, max_ip_len + 2]) resp = 'Port %s - IPv6 search result:' % port self.logger.log(format_text(resp, 'bold')) @@ -4001,6 +4004,8 @@ class STLClient(object): opts = parser.parse_args(line.split(), default_ports = self.get_acquired_ports()) if not opts: return opts + print(opts) + print(parsing_opts.ON_OFF_DICT) opts.prom = parsing_opts.ON_OFF_DICT.get(opts.prom) opts.mult = parsing_opts.ON_OFF_DICT.get(opts.mult) -- cgit 1.2.3-korg