summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/common
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/common')
-rwxr-xr-xscripts/automation/trex_control_plane/common/trex_stats.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/common/trex_stats.py b/scripts/automation/trex_control_plane/common/trex_stats.py
index f792ab9b..aecf44b4 100755
--- a/scripts/automation/trex_control_plane/common/trex_stats.py
+++ b/scripts/automation/trex_control_plane/common/trex_stats.py
@@ -83,6 +83,8 @@ class CTRexInfoGenerator(object):
return_data = {}
for port_obj in relevant_ports:
streams_data = self._generate_single_port_streams_info(port_obj, stream_id_list)
+ if not streams_data:
+ continue
hdr_key = "Port {port}: {yaml_file}".format(port= port_obj.port_id,
yaml_file= streams_data.raw_data.get('referring_file', ''))
@@ -186,6 +188,10 @@ class CTRexInfoGenerator(object):
return_streams_data = port_obj.generate_loaded_streams_sum(stream_id_list)
+ if not return_streams_data.get("streams"):
+ # we got no streams available
+ return None
+
# FORMAT VALUES ON DEMAND
for stream_id, stream_id_sum in return_streams_data['streams'].iteritems():
stream_id_sum['rate_pps'] = CTRexStats.format_num(stream_id_sum['rate_pps'], suffix='pps')