summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/common
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-02-01 03:45:44 -0500
committerimarom <imarom@cisco.com>2016-02-01 03:47:29 -0500
commitf9dcbd38e90601f5571bb5bcfb67170876ecd3c6 (patch)
tree4a6eb47e4a1a528e3df2c866c717b6cfad5d41c3 /scripts/automation/trex_control_plane/common
parent696cbfb3616a506cca7e7c68c1b92ff037f54f87 (diff)
simulator support (API and profiles)
Diffstat (limited to 'scripts/automation/trex_control_plane/common')
-rwxr-xr-xscripts/automation/trex_control_plane/common/trex_stats.py10
1 files changed, 9 insertions, 1 deletions
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),
"--": " ",
"---": " ",