summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-04-19 13:16:17 +0300
committerimarom <imarom@cisco.com>2016-04-19 13:16:17 +0300
commitf9b624fd56bc9f23d0bc4191cff929556f5e42a0 (patch)
treef0384ca40ae2b24651f24bf9b0dc1d97812b6a99 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py
parent6840551a8733fefdd8b3f235e4a802524ecc39d9 (diff)
parent3bafb0394c07ef2abb4ce34c7fb4ec01eb09f2df (diff)
Merge git://github.com/danklein10/trex-core into danklein10-master
also adding some tweaks to the TUI Conflicts: scripts/automation/trex_control_plane/stl/console/trex_tui.py
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py11
1 files changed, 10 insertions, 1 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 4057c50d..42bef360 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
@@ -251,6 +251,7 @@ class CTRexInfoGenerator(object):
return_stats_data = {}
per_field_stats = OrderedDict([("owner", []),
("state", []),
+ ("speed", []),
("--", []),
("Tx bps L2", []),
("Tx bps L1", []),
@@ -767,9 +768,17 @@ class CPortStats(CTRexStats):
else:
state = format_text(state, 'bold')
+ # mark owned ports by color
+ if self._port_obj:
+ owner = self._port_obj.get_owner()
+ if self._port_obj.is_acquired():
+ owner = format_text(owner, 'green')
+ else:
+ owner = ''
- return {"owner": self._port_obj.get_owner() if self._port_obj else "",
+ return {"owner": owner,
"state": "{0}".format(state),
+ "speed": self._port_obj.get_formatted_speed() if self._port_obj else '',
"--": " ",
"---": " ",