for some reason port status returned
fewer fields, catch this for debug
and return empty result dict so test continues
and hopefully we get a valid stat
read on next call.
Change-Id: I54f1a86707d2a00efcb82a7e0239d12f90a6542c
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
"1, 2 or 4 ports only supported at this time")
port_stats = self.vnf_execute('port_stats', range(len(self.vnfd_helper.interfaces)))
- rx_total = port_stats[6]
- tx_total = port_stats[7]
+ try:
+ rx_total = port_stats[6]
+ tx_total = port_stats[7]
+ except IndexError:
+ LOG.error("port_stats parse fail %s", port_stats)
+ # return empty dict so we don't mess up existing KPIs
+ return {}
+
result = {
"packets_in": tx_total,
"packets_dropped": (tx_total - rx_total),