From f9dcbd38e90601f5571bb5bcfb67170876ecd3c6 Mon Sep 17 00:00:00 2001 From: imarom Date: Mon, 1 Feb 2016 03:45:44 -0500 Subject: simulator support (API and profiles) --- scripts/automation/trex_control_plane/common/trex_stats.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts/automation/trex_control_plane/common') diff --git a/scripts/automation/trex_control_plane/common/trex_stats.py b/scripts/automation/trex_control_plane/common/trex_stats.py index 464ee56a..3bd6e0cd 100755 --- a/scripts/automation/trex_control_plane/common/trex_stats.py +++ b/scripts/automation/trex_control_plane/common/trex_stats.py @@ -524,8 +524,16 @@ class CPortStats(CTRexStats): def generate_stats(self): + state = self._port_obj.get_port_state_name() if self._port_obj else "" + if state == "ACTIVE": + state = format_text(state, 'green', 'bold') + elif state == "PAUSE": + state = format_text(state, 'magenta', 'bold') + else: + state = format_text(state, 'bold') + return {"owner": self._port_obj.user if self._port_obj else "", - "state": self._port_obj.get_port_state_name() if self._port_obj else "", + "state": "{0}".format(state), "--": " ", "---": " ", -- cgit 1.2.3-korg