summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-03-23 13:34:07 +0200
committerimarom <imarom@cisco.com>2016-03-23 13:34:07 +0200
commit552aaf480a7b994beb33b49fceccfcc9923e918d (patch)
treeef089094ca356edcccd4b2b6bbe7b29e4ec9d955 /scripts/automation/trex_control_plane/stl/trex_stl_lib
parent2bcbca455b063e3ef6f90e85a1fac4994a0e6a51 (diff)
console now supports python3
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py2
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py2
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py3
3 files changed, 4 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py
index 19479163..64e8688f 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py
@@ -976,7 +976,7 @@ class CRxStats(CTRexStats):
def generate_stats (self):
# for TUI - maximum 4
- pg_ids = filter(is_intable, self.latest_stats.keys())[:4]
+ pg_ids = list(filter(is_intable, self.latest_stats.keys()))[:4]
cnt = len(pg_ids)
formatted_stats = OrderedDict([ ('Tx pps', []),
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py
index 3af20f17..e5305c78 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py
@@ -26,6 +26,8 @@ class RC():
def __nonzero__ (self):
return self.good()
+ def __bool__ (self):
+ return self.good()
def add (self, rc):
self.rc_list += rc.rc_list
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py
index 29b6ba58..8917cd28 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_tables.py
@@ -23,8 +23,7 @@ def generate_trex_stats_table():
def print_table_with_header(texttable_obj, header="", untouched_header=""):
header = header.replace("_", " ").title() + untouched_header
print(format_text(header, 'cyan', 'underline') + "\n")
-
- print((texttable_obj.draw() + "\n").encode('utf-8'))
+ print((texttable_obj.draw() + "\n"))
if __name__ == "__main__":
pass