2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Fix event data for slot events

Slot events should generically have the Slot/Connector number.
Fix this by clarifying the description and allowing it
for any offset.  Additionally, the USB offset defined in
the spec is added.

Change-Id: I80dcb86ae58f47b794eab1571c292708edf83995
This commit is contained in:
Jarrod Johnson 2018-09-28 10:56:15 -04:00
parent 4a99f18023
commit ba1fc32e76

View File

@ -123,6 +123,7 @@ slot_types = {
9: 'PCIe',
10: 'SCSI',
11: 'SATA/SAS',
12: 'USB',
}
power_states = {
@ -251,7 +252,7 @@ def decode_eventdata(sensor_type, offset, eventdata, sdr):
return 'Requested {0] while {1}'.format(eventdata[1], eventdata[2])
elif sensor_type == 0x1d and offset == 7:
return restart_causes.get(eventdata[1], 'Unknown')
elif sensor_type == 0x21 and offset == 0x9:
elif sensor_type == 0x21:
return '{0} {1}'.format(slot_types.get(eventdata[1], 'Unknown'),
eventdata[2])