stanford-rc / sasutils

Serial Attached SCSI (SAS) Linux utilities and Python library
Apache License 2.0
62 stars 17 forks source link

sas_counters: Fix exception when bay_identifier returns EINVAL #7

Closed ghost closed 7 years ago

ghost commented 7 years ago

Any attempt to read the bay_identifier sysfs file returns EINVAL for some sas_end_devices, it seems. In this case, sas_counters.py errors out with the following traceback because unlike other parts of the code base that touch the bay_identifier attribute, ValueError isn't caught here so far:

(...)
  File "/usr/lib/python2.7/site-packages/sasutils/cli/sas_counters.py", line 101, in portsortfunc
    sortv[2] = int(port_n.end_devices[0].sas_device.attrs
ValueError: invalid literal for int() with base 10: '[Errno 22] Invalid argument'