inserted IB_PORTS[port_lid} into try, as port_lid might not be defined otherwise
if some of the ports are inactive (no cable connected), perfquery will not show them at all, but /sys/class/infiniband will recurse through them and during update_metrics bomb out.
unconnected ports have lid '0' so bypass these ports
2 changes: