2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 12:17:44 +00:00

Rename description field and split data out

It would be good for some consumers to have the broad event
description separated from the event specific data.  Facilitate
this with language that makes more clear the piece that refers
broadly to a class of things that can go wrong versus the
potentially very specific data associated with that event.

Change-Id: I983dc1cdf59ae8bc08db3ff3f55192e82f693dbe
This commit is contained in:
Jarrod Johnson 2015-05-06 15:45:11 -04:00
parent 0967ac6025
commit 349a4aa2eb

View File

@ -303,10 +303,10 @@ def _fix_sel_time(records, ipmicmd):
record = records[index]
if 'timecode' not in record or record['timecode'] == 0xffffffff:
continue
if record['description'] == 'Clock time change: After':
if record['event'] == 'Clock time change: After':
newtimestamp = record['timecode']
trimindexes.append(index)
elif record['description'] == 'Clock time change: Before':
elif record['event'] == 'Clock time change: Before':
if newtimestamp:
if record['timecode'] < 0x20000000:
correctearly = True
@ -390,14 +390,14 @@ class EventHandler(object):
sensor_type, '')
evreading = ipmiconst.generic_type_offsets.get(
event_type, {}).get(evtoffset, {})
event['description'] = evreading.get('desc', '')
event['event'] = evreading.get('desc', '')
event['severity'] = evreading.get('severity', pygconst.Health.Ok)
elif event_type == 0x6f:
event['entity_type'] = ipmiconst.sensor_type_codes.get(
sensor_type, '')
evreading = ipmiconst.sensor_type_offsets.get(
sensor_type, {}).get(evtoffset, {})
event['description'] = evreading.get('desc', '')
event['event'] = evreading.get('desc', '')
event['severity'] = evreading.get('severity', pygconst.Health.Ok)
if event_type == 1: # threshold
if byte3type == 1:
@ -408,8 +408,7 @@ class EventHandler(object):
additionaldata = decode_eventdata(
eventdata[3], evtoffset, event_data, self._sdr)
if additionaldata:
event['description'] = ': '.join((event['description'],
additionaldata))
event['event_data'] = additionaldata
def _sel_decode(self, origselentry):
selentry = bytearray(origselentry)